Heat the oven. Preheat to 350°F (175°C). Lightly grease a 9-inch pie dish.
Make the crust. In a bowl, mix almond flour, shredded coconut, sweetener, and salt.
Stir in melted butter and vanilla until the mixture looks like damp sand and holds when pressed.
Press and bake. Press the crust evenly into the pie dish, going up the sides. Dock the bottom with a fork. Bake 12–15 minutes until lightly golden.
Cool completely.
Toast the garnish. Spread coconut flakes on a small sheet pan and toast at 325°F (165°C) for 3–5 minutes, watching closely. Set aside.
Start the filling base. In a medium saucepan, whisk coconut milk, heavy cream, powdered sweetener, cocoa powder, and salt over medium heat. Warm until steaming and smooth, but not boiling.
Temper the yolks. In a separate bowl, whisk egg yolks.
Slowly ladle in about 1/2 cup of the hot mixture while whisking. Then pour the yolk mixture back into the saucepan, whisking constantly.
Thicken the custard. Sprinkle in coconut flour and whisk well to prevent lumps. Cook over medium-low heat, stirring constantly, until it thickens enough to coat the back of a spoon, 4–6 minutes.
Do not boil.
Add chocolate and vanilla. Remove from heat. Add the chopped chocolate and vanilla. Whisk until the chocolate melts and the filling is glossy.
Cool slightly and fill. Let the mixture sit 5 minutes, then pour into the cooled crust.
Smooth the top. Press a piece of plastic wrap directly onto the surface to prevent a skin.
Chill to set. Refrigerate at least 4 hours, preferably overnight, until firm enough to slice.
Whip the topping. Beat the cold cream with sweetener and vanilla to medium peaks. Spread or pipe over the chilled pie.
Finish and serve. Sprinkle with toasted coconut and add chocolate shavings if using.
Slice with a warm, dry knife for clean edges.