Preheat the oven to 425°F (220°C). Lightly coat a 9 x 13-inch baking dish with nonstick cooking spray.
Pour the vegetable broth or water into a large saucepan and bring it to a boil over medium-high heat.
Gradually whisk in the dried polenta and salt. Reduce the heat to low and simmer for about 15 minutes, stirring regularly to prevent sticking.
When the polenta is very thick and tender, remove it from the heat. Stir in the basil pesto and shredded smoked Gouda until evenly combined.
Immediately transfer the mixture to the prepared baking dish. Spread and smooth it into an even layer before it begins to firm.
Bake uncovered for about 25 minutes. Check the center; if it is still too soft to hold its shape, continue baking for another 5–10 minutes.
Remove the Baked Polenta from the oven and spread the marinara sauce evenly over the firm polenta layer.
Arrange 12 fresh basil leaves over the marinara, then place the mozzarella slices on top. Add freshly ground black pepper if desired.
Return the dish to the oven and bake for another 10–15 minutes, until the marinara is bubbling and the mozzarella is melted.
Remove from the oven and rest for at least 5 minutes. Garnish with the remaining fresh basil, slice, and serve warm.