Preheat the oven to 425°F (220°C).
Arrange the tomatoes, onion, and garlic on a large baking sheet.
Drizzle with olive oil.
Season with salt and black pepper.
Roast for 35 to 40 minutes until the vegetables are tender and lightly caramelized.
Transfer the roasted vegetables to a large pot.
Add the vegetable broth.
Bring to a gentle simmer for 10 minutes.
Add the basil leaves.
Blend until completely smooth using an immersion blender or countertop blender.
Stir in the heavy cream if using.
Taste and add sugar if needed to balance acidity.
Serve warm.