Prepare the oven and pan. Preheat the oven to 350°F (175°C). Line a 9 × 5-inch loaf pan with parchment paper, leaving an overhang on the sides.
Mix the dry ingredients. Whisk together the flour, baking soda, and salt in a medium bowl.
Cream the butter and sugar. In a large bowl, beat the softened butter and brown sugar until light and fluffy. Add the eggs and beat until incorporated, scraping down the bowl as needed.
Add the remaining wet ingredients. Add the mashed bananas, sour cream, and vanilla extract. Mix until combined.
Combine the batter. Add the dry ingredients and mix gently until no dry flour remains. Avoid overmixing. Fold in the chocolate chips or chopped chocolate with a spatula.
Fill and cover the pan. Transfer the batter to the prepared pan and smooth the top. Loosely tent with aluminum foil, leaving space for the bread to rise.
Bake. Bake for approximately 1 hour, removing the foil during the final 10 minutes so the top can brown. A toothpick inserted into the center should come out clean or with a few moist crumbs, without wet batter. If you hit melted chocolate, test another spot. Continue baking if necessary.
Cool. Let the bread rest in the pan for about 15 minutes. Lift it out using the parchment paper and transfer to a wire rack. Cool completely before frosting; cooling time will vary.
Make the optional frosting. Beat the softened cream cheese and butter until smooth. Add the powdered sugar and vanilla extract, then beat until creamy.
Frost and serve. Spread the frosting over the cooled chocolate chip banana bread. Cut into 10 slices and serve.