Prep the pan and oven. Heat the oven to 350°F (175°C). Line an 8-inch square pan with parchment, leaving overhang for easy lifting.
Lightly grease the parchment.
Melt butter and chocolate. In a heatproof bowl, melt the butter and chocolate together in the microwave in 20–30 second bursts, stirring between each, until smooth. Let cool 3–4 minutes so it’s warm, not hot.
Make the brownie base. Whisk in granulated sugar and brown sugar until glossy. Add 2 eggs and 1 teaspoon vanilla; whisk until thick and shiny, about 30 seconds.
Add the dry ingredients. Sift in flour, cocoa powder, and salt.
If using, add espresso powder now. Fold gently with a spatula until just combined. Do not overmix.
The batter will be thick.
Make the cream cheese layer. In a separate bowl, beat softened cream cheese with powdered sugar until smooth. Add 1 egg and 1 teaspoon vanilla; beat until creamy with no lumps. For extra insurance against lumps, make sure the cream cheese is fully at room temp.
Assemble. Spread about two-thirds of the brownie batter into the prepared pan, smoothing to the edges.
Dollop the cream cheese mixture over the top in large spoonfuls. Spoon the remaining brownie batter in small mounds around the cream cheese.
Create the swirl. Using a butter knife or skewer, gently drag through the batter in figure-eight motions. Aim for 4–6 passes total. Don’t over-swirl or the layers will blend into one color.
Bake. Place the pan in the center of the oven and bake for 28–34 minutes.
The edges will look set, and the center should have a slight jiggle but not be liquid. A toothpick inserted 2 inches from the edge should come out with a few moist crumbs, not wet batter.
Cool completely. Set the pan on a rack and let cool fully, at least 1–2 hours. For cleaner slices, chill for 45–60 minutes after cooling.
Slice and serve. Lift the brownies out using the parchment.
Use a sharp knife, wiping between cuts. If desired, sprinkle with flaky sea salt.