Preheat the oven to 350°F (177°C). Line a cupcake pan with 4 paper liners and place the pan on the middle oven rack.
In a small, microwave-safe bowl, combine 2 tablespoons (1 oz) unsalted butter, 2 tablespoons (21 g) chopped semi‑sweet chocolate, and 1 1/2 teaspoons vegetable oil. Microwave for 15 seconds, stir, then repeat in 10–15 second bursts, stirring between, until the mixture is fully melted and smooth. Set the bowl aside to cool until it is warm but not hot (about 2–3 minutes).
In a small bowl, whisk together 1/4 cup (30 g) all‑purpose flour, 2 tablespoons (11 g) cocoa powder (sift with a fine mesh strainer if lumpy), 1/2 teaspoon baking powder, and 1/8 teaspoon salt. Set this dry mixture aside.
In a medium bowl, whisk 1/4 cup (50 g) granulated sugar, 1 large egg yolk (room temperature), and 1/4 teaspoon vanilla extract until smooth and slightly thickened.
Whisk the slightly cooled chocolate mixture into the sugar–yolk mixture until the batter is uniform in color.
Add the flour–cocoa mixture to the wet mixture and whisk until just combined. Do not overmix.
Whisk in 2 tablespoons milk (any percentage) and 2 tablespoons hot coffee or water until the batter is smooth. The batter will be thin.
For easier filling, transfer the batter to a liquid measuring cup or use a spoon, and divide the batter evenly among the 4 prepared liners, filling each about two‑thirds full.
Bake for 16–19 minutes, or until a toothpick inserted into the center of a cupcake comes out clean or with a few moist crumbs. Remove from the oven.
Let the cupcakes cool in the pan until cool enough to handle (about 5 minutes). Transfer the cupcakes to a cooling rack and cool completely before frosting, about 15–20 minutes.
While the cupcakes cool, prepare the buttercream. Using a fine mesh strainer, sift 1 cup (120 g) powdered sugar and 1/4 cup (20 g) cocoa powder into a medium bowl to remove lumps.
Add 4 tablespoons (2 oz) unsalted butter (room temperature), 1 1/2 teaspoons milk, 1/2 teaspoon vanilla extract, a pinch of espresso powder (optional), and a pinch of salt to the sifted sugar and cocoa.
Use a handheld electric mixer to beat the frosting on medium speed until smooth and combined, scraping the bowl as needed. If the frosting is too thick, add more milk in 1/2 teaspoon increments until it reaches a spreadable or pipeable consistency.
Transfer the frosting to a piping bag or use a knife to spread it onto the cooled cupcakes. Top with sprinkles if desired.
Serve and enjoy.