To Make the Ice Cream
In a medium, heavy saucepan, cook the milk, cream, and all but 2 tablespoons of the pistachios over medium heat, stirring occasionally, until almost simmering. Turn off the heat, cover the pan, and let the pistachios steep in the cream for 15 minutes. In a medium bowl, whisk together the egg yolks, ¼ cup of the sugar, and the salt. Add the remaining ½ cup sugar to the pistachio cream and stir until dissolved. Slowly pour the cream into the eggs, whisking as you pour. Return the mixture to the pan and cook over medium-low heat, stirring constantly with a heat-resistant plastic or wooden spatula, until the mixture reaches 175°F and lightly coats the spatula. Cool over an ice bath and refrigerate for at least 4 hours or up to overnight. Strain the mixture into a clean bowl, discarding the pistachios. Churn in an ice cream machine according to the manufacturer’s instructions. Freeze until scoopable, about 4 hours, depending on your freezer.
To Make the Cupcakes
Preheat the oven to 350°F. Grease the insides of 6 large (about 3½ inches in diameter) muffin cups. Sift the cake and all-purpose flours, cocoa powder, and baking soda together onto a piece of parchment paper or into a bowl. Stir in the salt. In a large bowl, whisk together the egg and the brown and granulated sugars. In a small bowl, mix together the buttermilk, coffee, and canola oil. In 3 additions, alternately stir the wet and dry ingredients into the eggs. Divide the batter among the muffin cups. Bake until a skewer inserted in the center of a cupcake comes out clean, 15 to 20 minutes. Cool on a wire rack for 15 minutes. Carefully remove the cupcakes from the cups by running a knife around the inside edge of the cup. Let cool completely. Using a small knife, gently cut and remove enough of the inside of each cupcake so there is room for a scoop of ice cream. (Feel free to nibble on the scraps.)
To Make the Frosting
Melt the bittersweet and unsweetened chocolates and 1 ounce (2 tablespoons) of the butter in a double boiler over very hot water. Stir until smooth.
Sift the confectioners’ sugar into a large bowl and stir in the salt and milk. Stir in the melted chocolate and melted butter, mixing until well combined. Add the remaining 1 ounce (2 tablespoons) butter in 4 pieces, completely mixing in each piece before adding another. Stir until smooth. Let the frosting sit at room temperature until spreadable, about 2 hours. (If your kitchen is warm, you may have to briefly put the frosting in the refrigerator. Do not leave the frosting in the refrigerator too long or it will get too hard and a little grainy.) Stir occasionally to keep smooth.
The cupcakes and frosting can be made 1 day ahead. Store separately, well wrapped in plastic wrap, at room temperature. Assemble the cupcakes just before serving.