1/4 cup cornstarch
1/3 cup plus 2 tablespoons sugar, divided
3 tablespoons unsweetened cocoa powder
1/4 teaspoon salt
3 cups whole milk
2 ounces bittersweet chocolate, finely chopped
1 teaspoon pure vanilla extract
1 cup chilled heavy cream
Whisk together cornstarch, 1/3 cup sugar, cocoa powder, and salt in a 2-quart heavy saucepan, then gradually whisk in milk. Bring to a boil over medium heat, whisking constantly, then boil, whisking, two minutes (mixture will thicken). Remove from heat and whisk in chocolate and vanilla until smooth.
Pour filling into cooled shell and chill, its surface covered with wax paper (if you want to prevent a skin from forming), until cold, at least two hours.
Just before serving, beat cream with remaining two tablespoons sugar until it just holds soft peaks. Spoon onto pie and garnish with bittersweet chocolate shavings.
BEST Pie Crust (from the Barefoot Contessa)
12 tablespoons (1 1/2 sticks) very cold unsalted butter
3 cups all-purpose flour
1 teaspoon kosher salt
1 tablespoon sugar
1/3 cup very cold vegetable shortening
6 to 8 tablespoons (about 1/2 cup) ice water
Cut the dough in half. Roll each piece on a well-floured board into a circle, rolling from the center to the edge, turning and flouring the dough to make sure it doesn't stick to the board. Fold the dough in half, place in a pie pan, and unfold to fit the pan.
Prick bottom and side of shell all over with a fork, then chill shell 30 minutes. While shell chills, preheat oven to 375°F with a baking sheet on middle rack. Line shell with foil and fill with pie weights.
Bake on baking sheet until pastry is set and edge is pale golden, about 25 minutes. Carefully remove weights and foil, then bake shell on baking sheet until pale golden all over, 15 to 20 minutes more. Cool shell.