Preheat the oven to 400°F (200°C).
Trim the fennel: remove fronds and tops, cut the bulb in half crosswise, remove the core, then slice the bulb into even pieces and place on a baking sheet.
Add the cherry tomatoes to the baking sheet with the sliced fennel; drizzle with 2 tablespoons olive oil, sprinkle the lemon zest, chili flakes if using, and season with salt and pepper, then toss to coat.
Roast until the fennel is caramelized at the edges and the tomatoes have burst, about 30 minutes.
While the vegetables roast, heat 2 teaspoons olive oil in a deep skillet or braiser over medium heat.
Add the diced shallot and cook, stirring, until softened and translucent, about 4 minutes.
Add the orzo to the skillet and stir to coat with oil and shallot.
Stir in the cooked white beans and season the mixture with salt and pepper.
Pour in 2 cups vegetable stock, bring to a boil, then reduce to a simmer and cook until the orzo is tender and the mixture is creamy, about 8 minutes, stirring often and adding extra stock as needed to reach your desired consistency.
Once the orzo is soft and creamy, stir in the 3/4 cup vegan pesto and 1 tablespoon lemon juice until fully combined; adjust texture with more stock if needed.
Serve the pesto orzo topped with the roasted fennel and burst cherry tomatoes, and garnish with chopped basil if desired.