Preheat the oven to 400°F (200°C).
Heat the olive oil in a medium skillet over medium heat. Add the chopped onion and cook until tender, about 3 minutes.
Add the minced garlic to the skillet and cook for 2 minutes, then stir in the chopped spinach and cook until wilted. Remove from heat.
Pour the diced tomatoes into a large bowl and add the spinach mixture; set aside.
Bring the vegetable broth to a boil in a medium saucepan. Add the orzo and cook about 5 minutes so it is partially cooked. Drain the orzo in a colander, reserving the broth.
Stir the drained orzo into the tomato and spinach mixture. Add the shredded mozzarella, grated Pecorino Romano, chopped basil, and salt and pepper to taste; mix until combined.
Pour the reserved vegetable broth into a 3-quart baking dish. Trim the tops off the peppers and remove ribs and seeds. Trim a thin slice from each pepper base so they stand upright.
Arrange the peppers upright in the baking dish and spoon the orzo mixture into each pepper, filling them evenly.
Cover the dish with foil and bake for 40–45 minutes. Remove the foil, sprinkle additional mozzarella and Pecorino on top of each pepper, and continue baking until the cheese is golden, about 15 minutes.
Remove from the oven and let the peppers rest for 5 minutes before serving warm.