I'll state upfront that I got chatGPT to write this. I'm no programmer. But I do feel this could be useful in some application, so I've decided to put it on Github.
How this works is you upload the code onto the ESP32 and then connect to it on your phone or something over bluetooth. You then open a bluetooth serial app and open the terminal. You can then send messages from the phone and it will show up on the esp32s uart output, or you can send messages over the esp32s uart and it will show up on the phone.
You can also use another ESP32 to send and receiver so they can talk to eachother just like a phone and one ESP32 can.