Preheat oven to 425 degrees F. Line a large baking sheet with parchment paper.
Spread butternut squash cubes, quartered onion, and unpeeled garlic cloves on the baking sheet. Drizzle with olive oil and season with salt and pepper. Toss to coat evenly.
Roast for 35 to 40 minutes, tossing halfway through, until squash is fork-tender and edges are caramelized.
Let vegetables cool slightly. Squeeze garlic cloves out of their skins and transfer to a large pot along with the squash and onions.
Add vegetable broth, cinnamon, nutmeg, cayenne, and maple syrup. Bring to a simmer over medium heat and cook for 10 minutes.
Use an immersion blender to puree the soup until completely smooth, or blend in batches in a countertop blender.
Stir in lemon juice and taste for seasoning. Add cream or coconut milk if desired.
Serve hot, garnished with pumpkin seeds, fresh herbs, or a drizzle of cream.