Slice the onions: Peel and trim onions, then slice into thin half-moons about 1/8 inch thick. Mince the garlic and set aside.
Caramelize the onions: Melt butter with oil in a large skillet over medium heat. Add onions, sugar, salt, and pepper. Cook for 25-30 minutes, stirring occasionally, until deep golden brown and jammy.
Add garlic and flour: Stir in minced garlic and cook for 1 minute until fragrant. Sprinkle in flour and stir constantly for 2 minutes to cook out the raw taste.
Transfer to slow cooker: Scrape the onion mixture into the slow cooker. Add beef broth, wine (if using), Worcestershire sauce, balsamic vinegar, thyme, and bay leaves. Stir to combine.
Slow cook the soup: Cover and cook on LOW for 8 hours or HIGH for about 4 hours, until deeply flavored.
Season and finish: Remove bay leaves. Taste and adjust salt, pepper, Worcestershire, or balsamic as needed.
Toast the baguette: Slice baguette into rounds. Toast on a baking sheet at 350°F (175°C) for 6-8 minutes until dry and lightly crisp.
Assemble and broil: Ladle hot soup into oven-safe bowls. Float toasted baguette slices on top. Pile on shredded Gruyère and optional Swiss/provolone. Broil for 2-4 minutes until bubbling and browned.
Serve: Let bowls rest for a couple of minutes, then serve immediately with extra bread on the side.