Mix the flour and salt in a large bowl. Cut in the cold butter using a pastry blender until the mixture resembles coarse crumbs. Gradually add ice water, one tablespoon at a time, mixing gently with a fork until the dough holds together when pressed. Form into a disk, wrap in plastic, and refrigerate for at least 30 minutes.
Preheat your oven to 425°F (220°C). Roll out the chilled dough on a floured surface to fit a 9-inch pie plate. Trim edges, crimp decoratively, and prick the bottom with a fork. Line with parchment paper, fill with pie weights or dried beans, and bake for 12 minutes. Remove weights and paper, then bake for an additional 5 minutes until lightly golden. Cool completely.
In a medium saucepan, whisk together sugar, flour, and salt. Gradually stir in milk until smooth. Cook over medium heat, stirring constantly, until the mixture thickens and bubbles—about 8-10 minutes. Reduce heat; cook and stir 2 minutes longer.
Remove about 1 cup of the hot milk mixture and gradually whisk it into the beaten egg yolks to temper them. Return the egg mixture to the saucepan, stirring constantly. Bring to a gentle boil; cook and stir for 2 minutes.
Remove from heat; stir in butter, vanilla, and 1 cup of coconut. If using, add the coconut extract now. Pour into the cooled pie crust. Press plastic wrap directly onto the surface of the filling to prevent a skin from forming. Refrigerate until completely chilled, about 3-4 hours.
In a chilled mixing bowl, beat heavy cream until soft peaks begin to form. Add powdered sugar and vanilla, then continue beating until stiff peaks form. Spread or pipe the whipped cream over the chilled pie filling.
Spread the remaining 1/2 cup coconut on a baking sheet and toast in a 350°F (175°C) oven for 5-7 minutes, stirring occasionally, until golden brown. Allow to cool, then sprinkle over the whipped cream topping just before serving.