In a large pot, heat the butter and olive oil over medium-low heat. Add diced onions and cook gently, stirring occasionally, until soft and translucent, about 20 minutes.
Add flour and stir until mixture is slightly thickened and pale gold, about 3 minutes; do not allow to brown.
Stir in the tomatoes and their juices, red bell peppers, chicken broth, salt, red pepper flakes, thyme and pepper. Raise heat to medium until the liquid bubbles, then reduce heat to low. Simmer for 30 minutes, scraping the bottom of the pot frequently.
Stir in heavy cream (if using) and basil. Remove from heat and purée using a hand blender, or allow to cool until no longer steaming and purée in batches in a stand blender. Return to medium heat just until heated through.
Once the soup is done, preheat the broiler. Arrange the baguette slices on a baking sheet in a single layer. Slather the top with butter and sprinkle with garlic. Top the bread with the Gruyere and broil until bubbly and golden brown, 3 to 5 minutes.