Haven't done that in a year and a half, but when I spent a few weeks out of the country it was a simple matter of buying a $30 prepaid SIM from a vending machine at the airport and having more data than I had time to use. Honestly, no contracts or carrier locks has always made it easier to deal with travel compared to friends who occasionally have issues just swapping SIMs.
Unfortunately, the increasing prevalence of eSIMs in new phones makes temporarily switching to a foreign carrier far more inconvenient than "just buy a SIM at a vending machine".
The increased prevalence of eSIMs has made using a foreign carrier easier than ever. You don’t even need to find a vending machine or store. You can purchase your eSIM online before you even get to your destination.
iPhones (and probably Androids too) support up to 10 eSIMs with 2 active at the same time, if I'm not mistaken. And you can buy data eSIMs before even leaving the country in an app like Airalo.
Yes, it's much easier to buy ahead of time in the app and have it automatically activate upon arrival, instead of having to find a kiosk in the airport.