In a Dutch oven or large pot on medium heat, melt butter and olive oil. Add onions and stir to coat. Cook for about 15 minutes, stirring frequently, until onions start to soften and turn translucent.
Reduce heat to medium-low and continue cooking, stirring occasionally, for about 30-40 minutes, or until the onions are deeply caramelized and are a rich golden brown in color. Add the garlic during the last few minutes of cooking (watch so that the garlic does not burn).
Increase heat to medium-high. Add white wine and deglaze the pot by scraping any browned bits from the bottom with a wooden spoon. Cook until the wine is reduce by half, about 5 minutes.
Add beef stock, bay leaves, thyme, salt, and pepper. Bring to a boil, then reduce heat to low. Gently simmer for about 30 minutes to meld flavors together. Remove fresh thyme bunch and bay leaves before serving.
Meanwhile, preheat the broiler. On a baking tray, place baguette and top with shredded cheese. Broil 2-3 minutes, until the cheese is bubbling and golden brown. Watch carefully to not burn. Remove from the oven.
Add soup to bowls and top with broiled cheese toasts. Garnish with thyme leaves if desired. Serve immediately.
Notes
Keep leftovers in an airtight container in the refrigerator for up to 4 days. Store the cheese bread separately from the soup.