Make the crust. Heat the oven to 350°F (175°C). In a bowl, mix graham crumbs, sugar, and salt.
Stir in melted butter until the mixture resembles damp sand and holds when pressed.
Press and bake. Firmly press the mixture into the bottom and up the sides of a 9-inch pie plate. Use the bottom of a measuring cup to compact it evenly. Bake for 8–10 minutes, until lightly golden and fragrant.
Let cool completely on a rack.
Whisk the dry mix. In a medium saucepan (off heat), whisk sugar, cocoa, cornstarch, and salt until no lumps remain. If using espresso powder, whisk it in now.
Add milk and yolks. Slowly whisk in the milk until smooth, then whisk in the egg yolks. Place the pan over medium heat.
Cook the pudding. Cook, whisking constantly, until the mixture thickens and bubbles—about 6–9 minutes.
Once bubbling, continue to cook and whisk for 1 minute to fully activate the cornstarch.
Finish with chocolate. Remove from heat. Add chopped chocolate, butter, and vanilla. Whisk until smooth and glossy.
Strain for silkiness (optional but recommended). Push the hot pudding through a fine-mesh sieve into a bowl to catch any bits of cooked egg or cocoa clumps.
Fill the crust. Pour the warm pudding into the cooled crust.
Smooth the top with a spatula. Press plastic wrap directly onto the surface to prevent a skin from forming.
Chill to set. Refrigerate for at least 4 hours, preferably overnight, until firm and sliceable.
Whip the topping. Just before serving, whip the cream, powdered sugar, and vanilla to soft peaks. Spread or pipe onto the chilled pie.
Garnish with chocolate shavings or a light dusting of cocoa, if you like.
Slice and serve. Use a sharp, thin knife dipped in hot water and wiped dry between cuts for clean slices.