Yes, he could exit those countries hastily. But that has its own cost. Getting in wars is the easy part. Getting out of one is the hard part. Ask Putin who went into Ukraine on a 3-day limited special military operation.
Bush Jr. got us into multiple wars and unlike his father did not limit the scope of them. His father did get us into a war with Iraq but was smart enough to keep it limited in scope.
Also, under Obama, the "wars" were not real wars like the Russia/Ukraine war where both sides are losing hundreds of people every week. But they were more like peacekeeping operations that occasionally ran into skirmishes.
Peacekeeping is like the UN sending troops in to monitor a ceasefire. These were wars. 35,000+ civilian deaths in Afghanistan. Overthrowing Gaddafi. Tens of thousands of airstrikes against ISIS in Iraq and Syria. Drone strikes killing thousands of civilians in Pakistan. US foreign policy has equated “peace” and “stability” with its own military hegemony, being almost constantly at war to further its hypocritical ideology. It’s been a cash cow for the defense lobby.