Make the marinade. In a small bowl, whisk together the balsamic vinegar, olive oil, pesto, salt, and black pepper until fully combined.
Marinate the mushrooms. Place the cleaned portobello caps in a zip-top bag or shallow dish. Pour the marinade over them, seal or cover, and toss to coat. Let them marinate on the counter for 30 minutes, flipping the bag once or twice so both sides absorb the marinade.
Preheat the air fryer to 370°F (188°C) for about 3 minutes while the mushrooms finish marinating.
Air fry the mushrooms. Place the portobello caps stem side down (gill side up) in a single layer in the air fryer basket, making sure they aren't touching. Cook at 370°F for 7 to 9 minutes, until the caps are tender all the way through and the edges look glossy and caramelized. Do not flip — the gills hold the marinade and natural juices.
Add cheese (optional). During the last minute of cooking, open the basket, place a slice of cheese on each mushroom, and close the basket to finish cooking. The residual heat will melt the cheese.
Make the pesto mayo. While the mushrooms cook, stir the mayonnaise and pesto together in a small bowl.
Toast the buns. Remove the mushrooms and tent with foil. Place the buns cut-side up in the air fryer and toast at 370°F for 1 to 2 minutes, until lightly golden.
Build the burgers. Spread pesto mayo on both halves of each bun. Place a portobello cap gill side up on the bottom bun, top with a tomato slice, 2–3 basil leaves, and any optional toppings. Close the burger and serve immediately.