With the possible exception of IrDA, which in 2025 is like wanting a parallel port on a phone, pretty much all of that still exists.
Here's a phone with "a completely square display": https://www.walmart.com/ip/Rotatable-Phone-i19-Pro-Mini-Fold...
It even rotates but only the one screen.
I even found a phone with integrated barcode scanner, the UNIWA V9S.