Preheat the oven to 350°F (175°C).
Grease and line two 8-inch round cake pans with parchment paper.
Whisk together the flour, cocoa powder, sugar, baking powder, baking soda, and salt.
In another bowl, whisk together the eggs, buttermilk, oil, and vanilla.
Add the wet ingredients to the dry ingredients and mix until mostly combined.
Slowly pour in the hot coffee and mix just until smooth.
Divide the batter evenly between the prepared cake pans.
Bake for 28–33 minutes, until a toothpick inserted into the center comes out clean or with a few moist crumbs.
Cool in the pans for 10 minutes, then transfer to wire racks and cool completely.
Place the chopped chocolate in a heat-safe bowl.
Heat the heavy cream until steaming but not boiling.
Pour the cream over the chocolate and let it sit for 2–3 minutes.
Stir gently until smooth and glossy.
Add the butter if using.
Allow the ganache to cool until spreadable.
Place one cake layer on a serving stand and spread ganache over the top.
Add the second cake layer.
Spread or pour the remaining ganache over the top and sides.
Allow the ganache to set slightly before slicing.