Preheat the oven to 350 degrees F. Grease three 8-inch x 2-inch round cake pans generously with nonstick cooking spray. Line the pans with parchment paper, then spray the pans again. Set aside.
In the bowl of a stand mixer, whisk together the flour, sugar, cocoa powder, baking soda, baking powder, salt, and espresso powder, if using.
In a medium bowl, whisk together the buttermilk, oil, and vanilla extract.
With the stand mixer on low speed, slowly add the buttermilk mixture. Add the eggs, one at a time, and mix until well combined.
Slowly add the hot water and stir just to combine, stopping to scrape down the sides of the bowl. Briefly mix again. The batter will be thin and that is ok.
Dive the batter evenly among the prepared pans and bake for 22 to 28 minutes, or until a toothpick comes out clean when inserted into the center of the cakes. Remove the cakes from the oven and set them on a wire cooling rack.
Cool the cakes in the pans for 30 minutes, then turn them out onto a cooling rack and cool completely. You wrap the cake layers in plastic wrap and chill in the refrigerator or freezer. See note.
To make the frosting, using a stand mixer fitted with the paddle attachment, beat the butter until creamy and lighter in color, about 3 minutes, scraping down the bowl halfway through.
With the mixer on low, add the confectioner’s sugar, 2 cups at a time. You can start with 6 cups and add more later, if necessary. Add the cocoa powder.
Pour in 6 tablespoons of heavy cream, vanilla extract, and salt. With the mixer on low, add the melted chocolate. Mix for an additional 2 to 3 minutes, until the buttercream is light and fluffy. If the consistency of frosting is too thin, gradually add a little more sugar. If the frosting is too thick, add more heavy cream, a teaspoon at a time, until frosting is desired consistency.
To assemble the cake, first make sure the cake layers are flat and don’t have a rounded dome on top. If they do, carefully level off the top with a sharp serrated knife. You want the cake layers to be as even as possible.
Place the first layer bottom side up on a flat plate or cake stand. Using a knife or offset spatula, spread the top of the cake evenly with buttercream. Place the second layer on top, top side up, and spread more buttercream evenly over the top. Repeat with the third layer and frost the top and sides of the cake.
Decorate with sprinkles, chocolate shavings, or chocolate chips, if desired.
Use a sharp knife to cut the cake into pieces. Serve.