Preheat your oven to 350°F (175°C). Line a 9×9-inch pan with foil or parchment paper, and lightly spray the bottom to prevent sticking.
In a heavy pot over low heat, melt butter and chocolate together until smooth. Remove from heat and let it cool slightly.
Using an electric mixer, beat the sugar and eggs until well combined. Add flour, baking powder, and salt, and gently stir until just combined to avoid overmixing.
Split the batter into two bowls. Stir the chocolate mixture into one bowl, and in the other, combine pumpkin, oil, cinnamon, and pumpkin pie spice.
Layer the pumpkin and chocolate batters in the prepared pan. Use a knife to swirl them together, then sprinkle chocolate chips on top if desired.
Bake for 40–45 minutes, or until a toothpick comes out almost clean. Cool on a wire rack before cutting and serving.