Step 1 Make crust: Mix flour and salt together in a large bowl or the work bowl of a food processor. Add butter; either rub the butter bits into the flour with your fingertips, with a pastry blender or (in the food processor option) by pulsing the machine on in short bursts until the mixture resembles breadcrumbs. Sprinkle in cold water and mix it with a spoon, a few more cuts with a handheld pastry blender, or by pulsing the machine a couple more times. The mixture should form large clumps. Knead it gently into a ball; it will be on the firm side but should be easy to roll.
Step 2 Lightly butter a 9-inch round tart pan with a removable base. Don’t have one? Try a standard pie dish or even a 9-inch cake pan. The second two options will be hard/impossible to unmold later, but there’s no harm in serving the tart from its baking pan.
Step 3 Roll your dough out between two pieces of plastic wrap until it is about 11 inches in diameter. Peel the top plastic layer off and reverse the dough into the prepared tart pan, lifting the sides to drape (rather than pressing/stretching the dough) the dough into the corners. Press the dough the rest of the way in and up the sides. Trim edges, which you can leave ever-so-slightly extended above the edge of the tart pan, to give you some security against shrinkage. Chill for 15 minutes in your freezer.
Step 4 If par-baking the crust (see notes up top for pros/cons): Heat oven to 400 degrees. Lightly butter a piece of foil and press it tightly into your firm-from-the-freezer tart shell. Fill tart shell with pie weights, dried beans or rice or pennies and blind bake for 12 to 14 minutes. Remove from oven, carefully remove foil and weights, and return to oven for another 5 to 7 minutes, until lightly golden at edges. Set aside until needed.
Step 5 Make filling: Melt the butter and olive oil together in a large skillet over medium heat. Add the onions to the pan, toss them gently with the butter and oil, reduce the heat to medium-low, and cover the pan. Cook the onions for 15 minutes, then remove the lid, stir in the salt and sugar and saute without the lid for about 10 to 15 minutes, until the onions are fully caramelized and have taken on a deep golden color. Pour in cognac, if using it, and the stock, then turn the heat all the way up and scrape up any brown bits stuck to the pan. Simmer the mixture until the broth nearly completely disappears (wetter onions will make for a wetter quiche), about 5 to 10 minutes. Adjust the salt, if needed, and season with freshly ground black pepper. [Updated to add.] Let cool until warm. You can hasten this process by spreading the onions out on a plate in the fridge, or even faster, in the freezer.
Step 6 In a medium bowl, beat the egg and cream together. [Update] Gently stir the lukewarm onions into the custard.
Step 7 Heat oven to 400 degrees.
Step 8 Assemble and bake tart: Fill prepared tart shell with onion-egg mixture. Ideally, this will bring your filling level to 1/4-inch from the top, however, variances in shells, pans, pan sizes and even onion volume might lead you to have a lower fill line. You can beat another egg with cream together and pour it in until it reaches that 1/4-inch-from-top line if you wish. Sprinkle cheese over custard and bake 25 to 30 minutes, or until a sharp knife inserted into the filling and turned slightly releases no wet egg mixture. Serve hot or warm, with a big green salad.