Preheat the oven to 220°C/gas mark 7. Line two large baking sheets with parchment paper.
Peel the squash using a peeler. Trim off the stem and slice the squash in half, lengthwise. Using a spoon, scoop out the seeds (toss these in olive oil and spices and roast them later for snacking!). Using a sharp knife, slice the squash halves into 1cm slices.
Divide the squash between the two baking sheets. Drizzle 2 tablespoons olive oil over each baking sheet and season with a big pinch of coarse salt. Toss everything to evenly coat and arrange the squash slices in an even layer.
Roast until the undersides are darkened and slightly crisp along the edges, about 20 minutes. Flip and continue roasting until the squash is caramelised and tender all the way through, another 15 to 20 minutes.
Meanwhile, make the pepita pesto: to a food processor, add the pepitas, the basil, the garlic, and a pinch of coarse salt. Pulse until the basil is broken down into small shreds. Add the Parmesan and olive oil and pulse again, taking care not to overprocess the pesto. Aim for a coarse, saucy pesto. (You can also do this in a mortar and pestle.) Taste and add more salt or olive oil if needed.
Arrange the roasted squash on a serving platter. Dollop the pesto all over the squash, finish with flaky salt, and serve right away.