1. Peel and cut the onions into large chunks. You will have at least 6 cups of chopped onions. But don't worry too much about quantities with this recipe; if you have an extra onion to use up, throw it in! Melt the butter in the pan set over medium-low heat. After the butter foams up and then settles down, add the onions and stir to coat with the butter. Cover and cook for 15 minutes.
2. Season onions with 1 teaspoon salt, a generous quantity of black pepper, and 1/2 teaspoon sugar (this helps the onions caramelize). Cook the onions for 40 minutes to 1 hour on medium-high heat uncovered; stirring every few minutes until the onions are deeply browned. Turn down the heat if the onions scorch or stick to the pan; the browning doesn't come through burning, but through slow, even caramelization. Add 3 tablespoons flour to the caramelized onions and cook and stir for about 1 minute.
3. In separate pot, heat up broth. Add broth to onions, bring mixture to a boil and then reduce heat to simmer for at least 1 hour. If using wine, add this now too. Lower the heat and partially cover the pan. (If you want to add other aromatics such as herbs or spices, do so now. We suggest thyme!) Cook gently over low heat for at least 1 hour or until the broth is slightly reduced.
4. Taste and season with additional salt and pepper if needed. Add a finishing splash of brandy, if desired!
5. Top with toast and cheese: Heat the oven to 350°F. Divide the soup between small but deep oven-safe bowls. Top each with a slice (or two) of toasted baguette and sprinkle grated cheese in a thick layer over the bread and up to the edge of the bowl.
6. Bake for 20 to 30 minutes: Place the bowls on a baking sheet or in a casserole dish. Bake until the cheese is thoroughly melted. Broil until the cheese is browned: Turn the oven from bake to broil and broil the soup for 1 to 3 minutes or until the cheese is browned and bubbling. Remove carefully from the oven and let cool for a few minutes before serving on heatproof dishes or trivets. Serve with freshly ground pepper and minced fresh onion or shallot, which provides a welcome bite in contrast to the very sweet and mellow soup.