If I put thinly sliced raw pumpkin between two pie crusts, will the filling be cooked enough by the time the crust is golden?
Not only is this possible, I have done it. One of my favorites, in fact. But the most palatable version I've made varies a little bit from apple pie - rather than just tossing cinnamon sugar with the filling all willie nillie, I slice the squash very thin, line it against the edge of the crust, and keep working to the center. Think of it as like a tarte tatine - all lined up in a row (only this is not upside down like a tarte tatine).
Also, instead of just relying on caramelization on its own, I make a raw egg custard (just 4-5 egg yolks, a volume of sugar roughly equal to the quantity of the eggs, and some cream whipped together), add my nutmeg and cinnamon and other warm spices, and pour the raw custard all over the sliced sweet potatoes. I like to garnish with some additional nutmeg. Sometimes I like to add a splash of rum to the custard. It is so delicious, especially with a gingersnap based crust.
It's also possible (and encouraged) to brulee the top when the custard is done, and line the edge with some candied pecans.