In a large pot, heat the olive oil over medium heat. Add the chopped onion and sauté for about 5 minutes until softened.
Stir in the minced garlic and cook for an additional 1 minute until fragrant.
Add the diced tomatoes (with their juices), vegetable broth, sugar, and dried basil. Bring the mixture to a boil, then reduce the heat and simmer for about 15 minutes.
Blend the soup until smooth using an immersion blender, or transfer to a traditional blender in batches. Return to the pot and stir in the heavy cream if using. Season with salt and pepper to taste. Keep warm.
While the soup is simmering, heat a skillet over medium heat. Spread butter on one side of each slice of bread.
Place 4 slices of bread, buttered side down, in the skillet. Top each with 2 slices of cheese, then cover with the remaining 4 slices of bread, buttered side up.
Grill the sandwiches for about 3-4 minutes on each side, or until golden brown and the cheese is melted. Use a spatula to press down gently while cooking.
Slice the grilled cheese sandwiches in half and serve with bowls of warm tomato soup.