

As mentioned by CondorWonder, the LG via Serial HA Integration can already connect to a TCP socket instead of a TTY device.
If you want to use your Raspberry Pi as the serial proxy server, there’s tons of options. To recommend something kinda modern, I’d put a systemd service on your raspberry pi which starts netcat on a stty, see https://stackoverflow.com/a/71173551/2232127 as an example.

Well since the Pi is already there and has a serial interface, getting an ESP32 is still more expensive :)