Begin by preheating your oven to 350°F (177°C). Prepare a standard 12-cup muffin tin with paper liners. Since this recipe yields about 14 cupcakes, place two additional liners in a second pan. Set both pans aside.
In a large mixing bowl, sift together the flour, cocoa powder, optional espresso powder, baking powder, baking soda, and salt until well combined. In a separate medium-sized bowl, whisk the eggs, granulated sugar, brown sugar, oil, and vanilla extract until the mixture is completely smooth and uniform. Add half of this wet mixture to the dry ingredients, followed by half of the buttermilk. Whisk gently for a few seconds. Add the remaining wet ingredients and buttermilk, and stir just until the batter comes together. Be careful not to overmix. The batter should be quite thin.
Carefully pour or spoon the batter into the prepared liners, filling each only halfway—this is crucial to prevent overflow or sunken centers. Bake for 18 to 21 minutes, or until a toothpick inserted in the center of a cupcake comes out clean. Once baked, allow the cupcakes to cool completely before applying frosting.
Once cooled, frost the cupcakes using chocolate buttercream. You can spread it with an offset spatula or use a piping tip such as the Wilton 1M for a decorative swirl. Store any leftover cupcakes tightly covered in the refrigerator for up to 3 days. For storing or transporting frosted cupcakes, a cupcake carrier is highly recommended.