Preheat your oven to 350°F (175°C) and line a muffin tin with cupcake liners.
In a mixing bowl, whisk together the flour, baking powder, baking soda, and salt. Set aside.
In another bowl, cream together the softened butter and granulated sugar until light and fluffy using an electric mixer or whisk.
Add the egg, buttermilk, vanilla extract, and cooled espresso to the butter mixture. Mix until well combined.
Gradually add the dry ingredients to the wet ingredients, mixing until just combined. Do not overmix.
Divide the batter evenly among the cupcake liners, filling each about ⅔ full.
Bake in the preheated oven for 15-18 minutes, or until a toothpick inserted into the center comes out clean. Let the cupcakes cool in the pan for a few minutes before transferring to a cooling rack to cool completely.
In a small bowl, combine the brewed espresso and coffee liqueur (if using). Once the cupcakes have cooled, brush the espresso mixture over the tops of each cupcake to soak them slightly.
For the frosting, whip the heavy cream in a separate bowl until soft peaks form. Then, gently fold in the mascarpone cheese, powdered sugar, and vanilla extract until smooth.
Pipe or spread the mascarpone frosting over the cooled cupcakes. Dust with cocoa powder using a sifter for a finishing touch.