To make the stout cupcakes: Preheat oven to 350°F. Line 24 cupcake cups with liners. Bring 1 cup stout and 1 cup (2 sticks) butter to simmer in heavy large saucepan over medium heat. Add cocoa powder and whisk until mixture is smooth. Cool slightly.
Whisk flour, sugar, baking soda, and 3/4 teaspoon salt in large bowl to blend. Using electric mixer, beat eggs and sour cream in another large bowl to blend. Add stout-chocolate mixture to egg mixture and beat just to combine. Add flour mixture and beat briefly on slow speed. Using rubber spatula, fold batter until completely combined.
Divide batter among cupcake liners, filling them 2/3 to 3/4 of the way. Bake cake until tester inserted into center comes out clean, rotating them once front to back if your oven bakes unevenly, about 17 minutes. Cool cupcakes on a rack completely.
To make the whiskey ganache filling: Chop the chocolate and transfer it to a heatproof bowl. Heat the cream until simmering and pour it over the chocolate. Let it sit for one minute and then stir until smooth. (If this has not sufficiently melted the chocolate, you can return it to a double-boiler to gently melt what remains. 20 seconds in the microwave, watching carefully, will also work.)
Add the butter and whiskey (if you’re using it) and stir until combined.
Fill the cupcakes: Let the ganache cool until thick but still soft enough to be piped (the fridge will speed this along but you must stir it every 10 minutes). Meanwhile, using your 1-inch round cookie cutter or an apple corer, cut the centers out of the cooled cupcakes. You want to go most of the way down the cupcake but not cut through the bottom — aim for 2/3 of the way. A slim spoon or grapefruit knife will help you get the center out.
Put the ganache into a piping bag with a wide tip and fill the holes in each cupcake to the top.
To make the Baileys frosting: Whip the butter in the bowl of an electric mixer, or with a hand mixer, for several minutes. You want to get it very light and fluffy. Slowly add the powdered sugar, a few tablespoons at a time.
To frost the cupcakes: Once cupcakes have cooled, spread or pipe Baileys frosting evenly across all 24 cupcakes. Garnish with green sprinkles, if desired.