Preheat your oven to 400°F (200°C). Spread the pumpkin cubes on a baking sheet, drizzle with olive oil, and toss to coat evenly. Roast until the edges are golden and slightly caramelized, about 25-30 minutes.
Meanwhile, heat a tablespoon of olive oil in a large pot over medium heat. Add the chopped onion and sauté until translucent and fragrant, about 5 minutes.
Add the minced garlic to the pot and cook for another minute until fragrant, being careful not to burn it.
Once the roasted pumpkin is ready and cooled slightly, transfer it to the pot with the onion and garlic. Stir to combine, allowing the warm pumpkin to release more aroma.
Pour in the vegetable broth, bringing the mixture to a simmer. Let it cook gently for about 10 minutes so the flavors meld.
Use an immersion blender or carefully transfer the soup to a blender and blend until smooth and creamy. Return it to the pot if needed.
Stir in the cream or coconut milk if using, and season with salt and pepper to taste. Warm the soup gently until steaming hot, about 2-3 minutes.
Ladle the soup into bowls and serve hot, garnished with a swirl of cream, roasted pumpkin seeds, or fresh herbs if desired.