Preheat the oven to 350°F (175°C). Coat an 8 × 8-inch glass baking pan evenly with cooking spray to prevent the brownies from adhering.
Place the melted butter and cocoa powder in a large mixing bowl. Stir thoroughly until the mixture becomes smooth and evenly chocolate-colored.
Add the granulated sugar and room-temperature eggs. Beat until all ingredients are fully incorporated and the batter has a uniform consistency.
Fold in the slightly heaping flour and the chopped walnuts, if using. Mix only until no visible streaks of flour remain, taking care not to overwork the batter.
Transfer the brownie mixture to the prepared baking pan. Use a spatula to distribute the batter evenly across the pan.
Bake for approximately 20 minutes, or until the brownies have puffed slightly while the surface remains somewhat moist. Oven temperatures may vary, so monitor the brownies closely near the end of the baking period.
Remove the pan from the oven and place it on a wire cooling rack. Let the brownies rest for approximately 15 minutes; they should remain slightly warm.
Spread the chocolate icing evenly over the warm surface. Applying the icing before the brownies cool completely helps create a smooth, glossy finish.
Immediately scatter the candy corn pieces evenly over the freshly frosted brownies.
Leave the brownies at room temperature until they have cooled completely.
Once fully cooled, drizzle the melted chocolate over the top using a fork or piping bag to create a decorative pattern.
Allow the chocolate drizzle to set. Using a sharp knife, divide the brownies into 16 evenly sized bars before serving.