You could do that, but then you'd need to forgo USB Power Delivery, Qualcomm quick charging, etc.
One thing I've heard other comments mention here is a USB condom (USB data blocker). It's just a male to female adapter with only the power lines patched through, not data lines.
If you have a powerbank with you (which may be empty), you could also charge the powerbank using the untrusted power source, and at the same time charge the phone via powerbank to "sanitize" the source. This way you could still benefit from quickcharging.
Yep, this is what I usually end up doing while traveling. The battery doesn't care about the data lane even if the charger is somehow malicious, and my devices get pure juice.
I can't find any on Google that specifically are made without the data lane. Maybe these magnetic ones don't do data[0]. Could also try burning the data lanes on the lightning part of the cable[0] (although you might have issues if it's a lightning-to-C cable, I would guess it uses the data lanes for power negotiation).