Cut the courgettes in half across the middle, then cut each piece in half again and then into quarters lengthways to make batons.
Place the courgette batons in a roasting tin and add the shallots. Mix the olive oil and the pumpkin seed oil, if using, and use to coat the courgette batons and shallots. (If you don't want to use pumpkin seed oil, use 5 tablespoons olive oil in total instead.) Season with salt and pepper and cook at the top of a preheated oven, 190°C (375°F), Gas Mark 5, for 40 minutes.
Baste the courgettes and shallots 2–3 times during cooking. Once cooked, the courgettes and shallots should be soft and speckled with brown.