Combine the all-purpose flour, 1/4 cup cornstarch, and 3/4 teaspoon salt in a large mixing bowl, whisking until the dry ingredients are evenly distributed.
Add the cold, cubed unsalted butter. Work it into the flour mixture with a pastry cutter or fork until the texture resembles coarse crumbs.
Pour in the ice water gradually, approximately 2 tablespoons at a time, mixing gently after each addition. Continue only until the dough holds together when pressed and can be formed into a ball. Add a little additional ice water only when necessary.
Shape the dough into a flat disk and wrap it securely in plastic wrap. Refrigerate for at least 30 minutes and up to 1 hour. The wrapped dough may also be refrigerated for as long as 3 days.
Before rolling, allow the refrigerated dough to rest at room temperature for approximately 15 minutes so it becomes easier to handle.
Melt 2 tablespoons of unsalted butter in a large, heavy-bottomed skillet over medium heat.
Add the thinly sliced yellow onions and cook for approximately 35–45 minutes, stirring frequently, until they become deeply golden and thoroughly caramelized.
If the onions begin browning too rapidly or appear likely to burn, lower the heat or add a small splash of water to the skillet.
Once the onions are fully caramelized, stir in 1/2 teaspoon salt, 1/2 teaspoon black pepper, the crushed garlic, and finely chopped fresh thyme.
Continue cooking for 1 additional minute, stirring to distribute the seasonings evenly. Remove the skillet from the heat and allow the onion mixture to cool.
In a large bowl, whisk together the eggs and heavy cream.
In a separate small container, combine 4 teaspoons cornstarch with 1/4 cup cold water, stirring until completely smooth. Whisk this slurry into the egg and cream mixture.
Add the cooled caramelized onion mixture and whisk or stir until evenly incorporated.
Fold in the shredded Gruyère cheese and mix thoroughly.
Preheat the oven to 375°F.
Lightly coat a clean work surface with all-purpose flour. Place the chilled pastry dough on the prepared surface and roll it into an approximately 14-inch circle.
Cut rounds from the pastry with a 3-inch circular cookie cutter or a glass of comparable diameter.
Collect the remaining pastry scraps, gently roll them out again, and cut additional rounds as necessary.
Carefully press each pastry circle into an individual well of a mini muffin pan, forming small tartlet shells.
Spoon approximately 1 tablespoon of the caramelized onion filling into each pastry shell.
Transfer the filled tartlets to the preheated oven and bake for 25–30 minutes, or until the pastry has developed a golden color and the centers are completely set.
Allow the tartlets to cool in the pan until they are comfortable to handle. Carefully remove each tartlet from the mini muffin tray.
Serve the caramelized onion tartlets warm or at room temperature.