Preheat the oven to 350°F (175°C). If using a store-bought crust that needs blind baking, line the crust with parchment and pie weights and bake for 12–15 minutes until set and lightly golden. Cool completely.
Toast 1 cup of the shredded coconut in a dry skillet over medium heat, stirring frequently, until golden and fragrant, about 3–5 minutes. Transfer to a bowl to cool.
In a medium saucepan, whisk together the sugar, cornstarch, and salt. Gradually whisk in the whole milk and 1 cup heavy cream until smooth.
Place the saucepan over medium heat and cook, stirring constantly, until the mixture begins to thicken and comes to a gentle boil, about 6–8 minutes.
Temper the egg yolks by whisking a small amount of the hot milk mixture into the yolks, then slowly whisk the yolks back into the saucepan. Cook for 1–2 more minutes, stirring, until very thick.
Remove the saucepan from the heat and stir in the butter, vanilla extract, coconut extract (if using), and the toasted coconut. Mix until the butter is melted and the coconut is evenly distributed.
Pour the warm coconut custard into the cooled pie crust. Smooth the top with a spatula, cover the surface with plastic wrap to prevent a skin, and refrigerate until completely chilled and set, at least 3 hours.
Before serving, whip 1.5 cups heavy whipping cream with 2 tablespoons powdered sugar until soft peaks form. Spread or pipe the whipped cream over the chilled pie and sprinkle with the reserved toasted coconut.
Slice and serve chilled. Store leftovers covered in the refrigerator for up to 3 days.
Notes
For best texture, chill the pie overnight. Use sweetened coconut for a classic flavor; unsweetened will produce a less sweet filling.