I suspect that a cheap minimal MCU could not only do the job, but do it by scavenging power from the RS232 signal lines (like old serial mice did). It's really surprising how miserly these things can be with power requirements nowadays.
I keep a big jar around that's full of blue- and black pill MCU boards, as well as a few of the more capable STM32F4 and F7 boards. Nowadays, everything seems to look like a job for an MCU. I recall that a couple of years ago, either ED or EDN had an open question about whether it was preferable to replace NE555s with small MCUs--the parts price between the two being negligible. --Chuck