Melt the butter in a large heavy casserole. Add the onions and bay leaves, cover and cook over moderately high heat, stirring occasionally, until the onions are very soft, about 15 minutes. Uncover and cook over moderate heat, stirring occasionally, until the onions are deeply browned, about 1 1/2 hours longer. Add tablespoons of water as necessary if the onions dry out.
Add the flour to the onions and cook, stirring, for 2 minutes. Add the wine and cook, stirring constantly, until nearly evaporated, about 2 minutes. Add the beef stock and thyme and simmer over moderately low heat until reduced to 10 cups, about 35 minutes. Discard the thyme bundle and bay leaves and season the soup with salt and pepper.
Preheat the oven to 350°. Brush the baguette slices with the olive oil, arrange on a baking sheet and toast for about 12 minutes, or until golden and crisp.
Preheat the broiler. Ladle the hot soup into 10 heatproof bowls. Float 3 baguette toasts in each bowl and scatter the cheese on top. Set the bowls on a sturdy baking sheet and broil about 4 inches from the heat source for about 2 minutes, or until the cheese has melted. Serve at once.
The earthy, berry flavors and vibrant character of a good cru Beaujolais, made from the Gamay grape, go well with this rich, truffle-infused soup.