Prepare pie crust: Pre-bake the pie crust at 375°F (190°C) and cool it completely.
Make coconut filling: Whisk egg yolks and cornstarch; set aside. In a saucepan, whisk coconut milk, half-and-half, sugar, and salt over medium heat until boiling.
Temper eggs: Gradually add hot mixture to egg yolks, then return to saucepan and whisk until thickened.
Add coconut and flavoring: Stir in shredded coconut, butter, vanilla, and coconut extract (optional).
Fill pie crust: Pour warm filling into cooled pie crust, cover with plastic wrap (touching the surface), and refrigerate for at least 3 hours.
Make whipped cream: Whip heavy cream, sugar, and vanilla until medium peaks form (about 3-4 minutes).
Top pie: Spread or pipe whipped cream on top of chilled pie, garnish with extra coconut if desired.
Chill & serve: Refrigerate pie for a few hours or serve immediately.