Combine the chocolate and butter in a large heat-proof mixing bowl.
In a large saucepan (3 quarts) off heat, combine the cornstarch, sugar, cocoa powder and salt. Whisk in egg yolks, then add 1/4 cup of the of the cream and whisk until smooth. Whisk in another 1/4 cup of the cream until smooth.
Transfer mixture to stove top and set over medium heat. Whisk in remaining 1/2 cup cream, then gradually add the 2 cups of milk, whisking all the while until mixture begins to boil. Let boil for 1 minute, gently whisking all the while.
Remove from heat and pour over the chocolate and butter. Stir until fully mixed and smooth, then add vanilla extract and instant espresso if using.
Put a piece of plastic wrap over the pudding mixture and let it cool at room temperature for about an hour or until it is cool enough to put in the refrigerator. Refrigerate until fully cooled, then transfer mixture to the pie shell.
Whip the cream with the sugar and add vanilla. Pipe around edges of pie or if desired, spread over the top.