Yes, the iPhone iOS has had the option for using 4-digit passcodes for quite some time; it defaults to 6-digit.
The article is a bit misleading; yes, if someone has your phone's passcode, they can get in it and do whatever they wish.
But that's the same as, "If they have the key to your car, they can steal it," or "if they have the keys to your house, they can get in and steal everything." So yes, be cautious about typing in a PIN code when in a crowded restaurant or bar where there could be the chance that someone could be watching, but the actual likelihood of this happening is pretty slim.
We go overseas a lot, and I use my iPhone 14 Pro to take photos these days (my Nikon 700 and expensive lenses are in a drawer gathering dust). I bought a case with a very strong wrist strap on it (https://www.amazon.com/gp/product/B08HVGF24C/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1), which I use only when I'm traveling; it will keep someone from grabbing my phone when I'm on the street, plus it secures the phone when I'm taking photos from a balcony, cruise ship railing, or other precarious spots. Because of the wrist strap, I tend not to put my phone down very often in public, instead letting it dangle. Much safer.
There are basic things one can do to stay safe--use a travel wallet (I prefer the over-the-neck variety); use a sturdy day pack and put the strap crosswise over the body; don't let strangers engage you on the street (this of course doesn't include sidewalk vendors); don't venture into unknown neighborhoods at night unless you know it's a safe area and you know where you're headed; leave expensive jewelry at home; if you're going to do some drinking, plan ahead and have a way to get back safely to your hotel.
I always keep my eyes peeled when I'm in a train or bus station; thieves get in and out easily, and the stations are usually bustling and crowded.