Preheat oven to 350°F. Line a 12-cup muffin pan with paper liners.
Whisk flour, cocoa, baking soda, baking powder, and salt in a bowl. Set aside.
Warm stout and butter in a saucepan over medium heat until melted. Remove from heat.
Whisk in both sugars until dissolved. Let the mixture cool for 5 minutes.
Add sour cream, eggs, and vanilla to the pan. Whisk until smooth and glossy.
Fold dry ingredients into the wet mixture just until combined. Do not overmix.
Divide batter among liners, filling each about two-thirds full. Bake 18–22 minutes.
Cool cupcakes in pan 5 minutes, then transfer to a rack to cool completely.
Beat cream cheese and softened butter until creamy. Add powdered sugar, vanilla, and salt; whip until fluffy.
Stream in heavy cream to reach spreadable consistency. Mix in Irish cream if using.
Spread or pipe frosting on cooled cupcakes. Serve immediately or chill to set.