Melt butter and olive oil in a large, heavy-bottomed pot or Dutch oven over medium heat.
Add sliced onions and cook slowly over low heat for 40-50 minutes, stirring occasionally, until deeply caramelized and golden brown. Patience is key!
If using, deglaze the pot with sherry or white wine, scraping up any browned bits from the bottom.
Add beef stock, bay leaf, and thyme. Bring to a simmer and cook for 30 minutes to allow the flavors to meld.
Remove the bay leaf. Taste and adjust seasoning as needed.
Preheat broiler. Place oven-safe bowls on a baking sheet.
Ladle soup into bowls. Top each bowl with a slice of toasted baguette and a generous amount of grated Gruyère cheese.
Broil for 2-3 minutes, or until the cheese is melted and bubbly.
Serve immediately.