Preheat your oven to 350°F (175°C) and grease a 9-inch pie dish or tart pan.
In a saucepan over low heat, melt the butter. Once melted, remove from heat and stir in both sugars until combined.
Add the eggs one at a time, mixing well after each addition. Stir in the vanilla extract.
In a separate bowl, whisk together the flour, cocoa powder, baking powder, and salt.
Gradually add the dry ingredients to the wet mixture, stirring until just combined. Avoid overmixing.
Fold in the chocolate chips and walnuts (if using).
Pour the batter into the prepared pie dish, smoothing the top with a spatula.
Bake in the preheated oven for 25-30 minutes, or until the edges are set and a toothpick inserted in the center comes out with a few moist crumbs (not too clean).
Let the brownie pie cool completely in the pan before slicing. This allows the center to set up perfectly.
Serve warm with a scoop of ice cream or a dollop of whipped cream on top for an extra indulgent treat.
Notes
Serve warm with ice cream or whipped cream for an extra treat.