For the filling, peel and seed the pumpkin or squash and slice into 1-inch thick slices.
Combine 6 cups of water and piloncillo in a pot large enough to hold the pumpkin and bring to a boil, stirring until piloncillo dissolves. Add orange zest and juice, canela, and pumpkin and simmer until pumpkin is just tender, about 15 minutes.
Remove pumpkin to a large plate and increase heat to medium-high, bringing to a boil. Boil until liquid has thickened to a maple syrup consistency and has been reduced to about 1 cup, about 35 minutes. Strain and let cool.
To make the dough, combine flour, salt, and sugar in a medium bowl. Add the coconut oil and toss the pieces in the flour mixture to coat.
Using a pastry cutter or your fingers work the oil into the flour until it resembles small pebbles. Add 1/4 cup of ice water and gently work that into the dough with your hands.
Squeeze a handful of dough in one hand, if it doesn't easily hold together, add more water 1 tablespoon at a time until it does. Gather the dough into a ball and wrap in plastic wrap. Press down to a disk shape and let chill in the refrigerator for 20 minutes.
Heat oven to 400°F and arrange a rack in the bottom. Cover a rimmed baking sheet with parchment paper.
On a lightly-floured surface, roll dough out into a circle about 1/4-inch thick and 14-inches wide. Roll the dough up over the rolling pin and transfer to the parchment-covered baking sheet, letting the dough hang over the sides.
Place the pumpkin slices in a decorative patter in the center of the dough. Pour half the syrup over the pumpkin and fold the dough up over the pumpkin creating a 2-inch border, pinching the dough together in four or five spots to make sure it holds together.
Beat the egg with a tablespoon or two of water and brush over the border of the dough. Sprinkle with turbinado sugar.
Bake until crust is golden brown and pumpkin is very tender, about 45 minutes. Let cool at least 30 minutes before slicing and serving with whipped cream or ice cream and the remaining syrup.