In the slow cooker, combine the sliced onions, butter, olive oil, salt, and sugar. Stir to combine.
Cover and cook on low for 6 hours, stirring occasionally, until the onions are deeply caramelized and golden brown.
After 6 hours, add the minced garlic and stir well. Cook for an additional 15 minutes.
Pour in the beef broth and wine (if using). Add thyme, bay leaf, Worcestershire sauce, and black pepper. Stir to combine.
Cover and cook on low for an additional 30 minutes to allow the flavors to meld.
Preheat your broiler. While the soup is cooking, toast the slices of French bread until golden brown.
Once the soup is done, remove the bay leaf. Ladle the soup into individual oven-safe bowls or ramekins.
Place a slice of toasted bread on top of each bowl and generously sprinkle with Gruyère cheese.
Broil for 2-5 minutes or until the cheese is melted and bubbly. Keep a close eye to avoid burning.
Serve immediately and enjoy!