Prepare your workspace by gathering all ingredients and measuring them out.
Create the base by combining sugar, cornstarch, and salt in a medium saucepan. Whisk thoroughly to remove any lumps.
Gradually add the milk, whisking constantly until completely smooth.
Cook over medium heat, stirring constantly, until mixture begins to thicken and bubble, about 6-8 minutes. Once bubbling, cook for 2 more minutes, continuing to stir.
Temper the egg yolks by gradually whisking about 1 cup of the hot mixture into the beaten egg yolks.
Return the tempered eggs to the saucepan, whisking constantly. Bring back to a gentle boil and cook for 2 more minutes, stirring continuously.
Remove from heat and add chopped chocolate, butter, and vanilla. Stir until chocolate is completely melted and mixture is smooth.
Pour the filling into your pre-baked pie crust. Smooth the top with a spatula.
Press plastic wrap directly onto the surface of the filling to prevent a skin from forming. Refrigerate for at least 3 hours or overnight until firmly set.
Before serving, whip the heavy cream with powdered sugar until stiff peaks form. Spread or pipe the whipped cream over the chilled pie.
Garnish with chocolate shavings or curls and serve immediately or return to refrigerator until ready to serve.