Add the canned coconut milk to a saucepan.
In a separate bowl, whisk together the sugar, cornstarch, and optional turmeric (if using, for color only). Add this mixture to the saucepan, whisking to combine.
Bring the mixture to a simmer over low–medium heat, whisking as it heats. Once it comes to a boil, whisk continuously and let it boil for 30 seconds. The custard will become thick and smooth.
Remove the saucepan from the heat. Stir in the vanilla extract and shredded coconut.
Spread the coconut pastry cream evenly over the cooled pie crust. Cover with plastic wrap touching the surface of the custard. Refrigerate for 5–6 hours, or until completely set.