Preheat the oven to 350°F (175°C). Grease and flour two 9-inch round cake pans.
In a large mixing bowl, whisk together the flour, baking soda, baking powder, cocoa powder, and salt.
In another bowl, cream the vegetable oil and granulated sugar together until light and fluffy.
Add the eggs, one at a time, beating well after each addition. Mix in the vanilla extract and red food coloring.
Mix in the buttermilk and cooled espresso until just combined.
Gradually add the dry mixture to the wet ingredients, mixing until just combined.
Divide the batter evenly between the prepared cake pans and smooth the tops.
Bake in the preheated oven for 25-30 minutes, or until a toothpick inserted in the center comes out clean.
Allow the cakes to cool in the pans for 10 minutes before transferring them to a wire rack to cool completely.
Prepare the mocha frosting by beating the softened butter until creamy. Gradually add the powdered sugar, mixing well.
Mix in the heavy cream, cocoa powder, and vanilla extract until the frosting reaches a spreadable consistency.
Place one cake layer on a serving platter and spread a layer of frosting on top. Place the second layer on top and frost the top and sides of the cake.
Decorate with chocolate shavings or espresso beans if desired, and let the cake set for 30 minutes before slicing.