Preheat your oven to 350°F (177°C). Grease two 9-inch round cake pans, then line the bottoms with parchment paper rounds. Grease the parchment paper as well. This extra step ensures the cakes release easily after baking.
Make the cake: In a large bowl, whisk together the flour, cocoa powder, granulated sugar, baking soda, baking powder, salt, and espresso powder (if using). Set the dry ingredients aside. In a separate bowl or using a handheld or stand mixer fitted with the whisk attachment, combine the oil, eggs, and vanilla extract. Mix on medium-high speed until fully blended. Add the buttermilk and mix again until smooth. Pour the wet mixture into the bowl with the dry ingredients. Add the hot coffee or hot water and whisk or mix on low speed until everything is fully incorporated. The batter will be very thin—this is expected and helps create a moist cake.
Divide the batter evenly between the prepared pans. Bake for 23 to 26 minutes, or until a toothpick inserted into the center of each cake comes out clean. Keep an eye on your cakes, as baking times can vary slightly by oven. Note: even when fully baked, the centers of the cakes may sink slightly after cooling. This is normal due to the high moisture content and the lower structural strength of cocoa powder compared to flour.
Remove the cakes from the oven and place them on a wire rack. Allow the cakes to cool completely in the pans before removing them.
Make the chocolate buttercream: In a large mixing bowl, beat the softened butter using a handheld or stand mixer fitted with a paddle attachment on medium speed for about 2 minutes, or until creamy. Add the confectioners’ sugar, cocoa powder, 3 tablespoons of heavy cream, salt, and vanilla extract. Mix on low speed for about 30 seconds, then increase to high speed and beat for 1 full minute until smooth and fluffy. Do not over-whip the frosting. If it’s too thin, add an additional ¼ cup of confectioners’ sugar or cocoa powder. If it’s too thick, add 1–2 more tablespoons of cream as needed. Taste the frosting and add a small pinch of salt if desired to enhance the flavor.
Assemble and frost the cake: If the cake layers are domed, level them using a large serrated knife to create flat tops. Discard the trimmed pieces or crumble them for decoration later. Place one cake layer on a cake stand or serving plate and spread a generous amount of frosting evenly over the top. Add the second cake layer on top, then spread the remaining frosting over the top and sides of the cake. Use an icing spatula and bench scraper to smooth the frosting as desired. Decorate with semi-sweet chocolate chips, if you like.
Refrigerate the assembled cake uncovered for 30 to 60 minutes to help the frosting set. After that, you can either serve the cake or keep it refrigerated for up to 4 to 6 hours before serving. Serve chilled or at room temperature.
To store, cover any leftover cake tightly and keep it in the refrigerator for up to 5 days. A cake carrier works especially well for storing and transporting the cake.