In a large pot or Dutch oven, heat butter and olive oil over medium heat. Add sliced onions and cook for 35-40 minutes, stirring occasionally, until golden brown.
- Add minced garlic and cook for another 1-2 minutes. Add wine (if using) and scrape the pot to loosen browned bits. Let the wine reduce for 2-3 minutes.
- Add beef broth, thyme, bay leaf, salt, and pepper. Bring to a simmer and cook for 20-30 minutes, adjusting seasoning. Add balsamic vinegar for extra flavor if desired.
- While the soup simmers, preheat the oven to 350°F (175°C). Toast bread slices in the oven for 8-10 minutes, until golden and crispy.
- Ladle soup into oven-safe bowls, place toasted bread on top, and sprinkle with grated Gruyère cheese.
- Preheat the broiler, then place the bowls under the broiler for 2-3 minutes until the cheese is melted and bubbly. Keep an eye on it to avoid burning.
- Carefully remove the bowls from the oven and serve immediately, garnished with fresh thyme if desired.