Preheat your oven to 350°F (175°C) and line a 12-cup muffin tin with cupcake liners.
In a medium bowl, whisk together the flour, baking powder, baking soda, and salt. Set this bowl aside.
In a large bowl, beat the softened butter and granulated sugar until the mixture is light and fluffy. Add the eggs, one at a time, making sure to mix well after each addition. Stir in the vanilla extract.
Gradually add the dry mixture to the wet ingredients, alternating with the buttermilk. Start and end with the dry ingredients, mixing until just combined.
Gently fold in the cooled espresso or coffee. Divide the batter evenly among the cupcake liners.
Bake in the preheated oven for 18-20 minutes, or until a toothpick inserted into the center comes out clean. Allow the cupcakes to cool completely on a wire rack.
To prepare the coffee soak, mix the espresso and optional coffee liqueur in a small bowl. Once the cupcakes are cool, poke holes in the tops and brush on the coffee mixture.
For the frosting, beat the chilled heavy cream until soft peaks form. In another bowl, mix the mascarpone, powdered sugar, and vanilla until smooth. Fold the whipped cream into the mascarpone mixture.
Pipe or spread the frosting onto the cupcakes, and dust with cocoa powder just before serving.