In a large bowl, whisk the cocoa powder, flour, sugar, baking powder, and salt until combined. In a separate bowl, whisk the melted butter, eggs, stout beer, and vanilla extract. (If the butter gets too cold and it separates, use a double boiler, setting the bowl on top, and whisk to heat just until it comes together again.) Add the wet ingredients to the dry in batches, beating with a standing or hand-held mixer on medium speed until the batter is smooth and shiny, about 20 seconds. Pour into the cupcake molds, filling about ¾ of the mold, and bake for 20-25 minutes. It is ready if you test with a toothpick and it comes out clean. Remove from oven and allow to cool completely on a wire rack.