Preheat the oven to 325° F. Cut the top off each squash and set aside. Use a teaspoon to scoop out the seeds and fibrous pulp from the centre of each squash. Use a sharp knife to cut away the squash flesh around the top cut edge to leave a 1/2-inch rim and give a bowl shape to each squash. You're not going to have a ton. You could top it up with some more squash bought separately, but it's fine as is, as you will have the roasted squash from inside the squash bowls to eat, as well.
Roughly chop the flesh you have removed. Place the hollowed-out squashes and their lids onto a baking sheet (cut side down) and bake for 45 minutes to 1 hour until softened, but still retaining their shape (check regularly after 30 minutes, as baking time will vary depending on size of squash and how much flesh you cut away). Once out of the oven, flip large piece over so it's cut side up and allow to cool for 5-10 minutes before filling.
Heat the vegetable oil in a large saucepan and fry the onion for 5 minutes until softened. Stir in the curry paste and pumpkin flesh and cook for 2 minutes, stirring continuously. Pour the coconut milk over the mixture and stir to combine. Add the fish sauce, lime juice, lemongrass, basil and chili pepper.
Simmer for 15 minutes until the pumpkin flesh is tender. Season to taste with salt and freshly ground black pepper and stir in the spinach. Cook until just wilted. Spoon the mixture into the centre of each squash and serve immediately.