Yes you can use a UART on GPIO pins, thats normally how a processor with internal UART
is used, and then its I/O is passed to a level translator to get the RS232 levels.
If you have concern about ESD environment, and shorts, you can always do this on the
pin externally -
View attachment 171089
R value to limit pin current when esd tries to take pin outside its supply rails.
1K ohms, depends on com speed. Just do a 5 x RC with C the pin C, and 5 x RC
<< bit time. Use small signal diodes to get fast turn on time. Additional margin
can be had using Schottky diodes.
Note some folks rely on internal parasitic diodes in CMOS and just use the R
on the pin.
Regards, Dana.