Prepare the Crust
If using a homemade or store-bought pie crust, bake it according to the instructions and allow it to cool completely.
Make the Chocolate Filling
In a medium saucepan, whisk together sugar, cornstarch, and salt. Gradually whisk in the milk until smooth.
Cook over medium heat, stirring constantly, until the mixture thickens and starts to bubble.
In a separate bowl, lightly whisk the egg yolks. Slowly pour about 1/2 cup of the hot milk mixture into the yolks, whisking constantly to temper the eggs.
Pour the tempered yolks back into the saucepan and cook for 2-3 minutes, stirring continuously.
Remove from heat and stir in the chopped chocolate, butter, and vanilla extract until smooth.
Assemble the Pie
Pour the chocolate filling into the prepared pie crust. Smooth the top with a spatula.
Cover the pie with plastic wrap, ensuring it touches the surface of the filling to prevent a skin from forming. Refrigerate for at least 4 hours or until fully set.
Prepare the Whipped Cream
In a large bowl, beat the heavy whipping cream, powdered sugar, and vanilla extract until stiff peaks form.
Decorate the Pie
Remove the pie from the refrigerator and spread or pipe the whipped cream over the chocolate filling.
Garnish with chocolate shavings or curls if desired.