For the cupcakes, preheat oven to 350° F. Grease or line 22 cups in standard-size muffin tins. Set aside.
Melt chocolate in a double boiler or in a bowl set over a pan of simmering water. Set aside to cool slightly.
Combine flour, cocoa powder, baking soda, and salt in a bowl and set aside.
Add Kahlua to a glass measuring cup and then spoon in sour cream until the two ingredients reach the 1-cup line. Stir in water (or milk or coffee) and vanilla extract. Mix well and set aside.
In the bowl of a standing electric mixer, cream together butter and sugar until light and fluffy. Add the eggs to the butter mixture, one at a time, beating well after each addition. Add the chocolate mixture and stir to mix.
Alternate adding the flour mixture and sour cream mixture to the batter in two additions. Stir until well combined. Fold in chocolate chips.
Fill prepared muffin cups about half full with batter. Bake in preheated oven until firm to the touch and a tester inserted in the center of a cupcake comes out with a just few crumbs clinging to it, about 13 to 15 minutes. Remove from oven and cool in pans.
To prepare the frosting, combine Kahlua, milk, espresso powder, and salt in the bowl of a standing electric mixer. Swirl the bowl gently until espresso powder and salt have dissolved.
Add 3 1/2 cups of the confectioners' sugar and the butter. Mix slowly with the paddle attachment to combine, and then increase speed to medium-high and beat until smooth and creamy. Add additional powdered sugar if needed to achieve a frostable consistency.
Pipe frosting atop cooled cupcakes or use a small spatula to add a generous layer of frosting to each cupcake. Garnish with cocoa nibs or chocolate shavings.