For the cupcakes: Position a rack in the middle of the oven and preheat to 350 degrees F. Line 12 (1/2-cup) muffin cups with paper liners. Whisk the flour with the cocoa powder, baking soda, baking powder, and salt.
Beat the butter with an electric mixer at medium speed until smooth, about 2 minutes. Increase the speed to medium-high and gradually add the sugar. Beat until light and smooth, about 5 minutes. Reduce the speed to medium-low and beat in the whole eggs and yolk 1 at a time, incorporating each fully before adding the next. Beat in the vanilla. Scrape down the sides of the bowl.
Bring water just to a boil in a small saucepan and remove from the heat. With the mixer at low speed, beat the flour mixture into the butter mixture in 4 additions. Drizzle in the hot water, about 2 tablespoons at a time, and mix briefly to make a smooth batter. Divide the batter among the muffin cups filling them 2/3 full. Bake until the centers of the cupcakes spring back when pressed gently, about 20 minutes. Cool the cupcakes in the tin on a rack for 10 minutes then remove from the tin and cool completely before frosting.
For the frosting: Put the chocolate in a medium heatproof bowl. In a small saucepan, bring cream to a boil. Pour cream over chocolate and shake the bowl gently so cream settles around the chocolate. Set mixture aside until the chocolate is soft, about 5 minutes. Whisk gently until smooth, taking care not to incorporate too many air bubbles. Stir in 1 of the flavorings, if desired. Dip the tops of the cooled cupcakes into the frosting. (Frosting can also be chilled and whipped, then piped or spread onto the cupcakes.) Set them upright and let stand 1 or 2 minutes, until frosting is slightly set, then decorate with fresh berries, candies, or chopped pistachios, if desired. Let cakes stand on rack until frosting is completely set.