Heat olive oil (or butter) in a large pot over medium heat. Add diced onion and cook for 3–4 minutes until soft and translucent.
Add garlic and cook for a further 30 seconds until fragrant.
Stir in chopped pumpkin and potatoes (if using), coating them in the onion and garlic mixture.
Pour in the stock and bring to a gentle boil.
Reduce heat and simmer for 25–30 minutes, or until the pumpkin is very soft and easily pierced with a fork.
Remove from heat and blend the soup using a stick blender (or transfer carefully to a blender) until completely smooth and creamy.
Return to low heat and stir through cream (if using). Season generously with salt and pepper to taste.
Adjust consistency with a little extra stock or water if needed.
Serve hot with crusty bread, croutons, or your favourite toppings.