In the bowl of a standing mixer, beat the butter and sugar until smooth and creamy, about 3 minutes. Add eggs and vanilla, mix until combined. Beat in half of the dry ingredients, then half of the cocoa mixture. Repeat and mix until all ingredients are incorporated, scraping the sides and bottom of the bowl if needed. Fill cupcake liners 2/3 full and bake for about 20 minutes, until springy and a toothpick comes out clean. Let cool in the pan for 5 minutes, then transfer to cooling rack.