I've seen "hardware autobaud" features described for some modern UART peripherals.
I'm not sure that it's an interesting problem on a microcontroller. Just start the pins in GPIO mode and time the start bit. If there's a specific autobaud character, you can confirm using the rest of the bits. If not, you could consider timing the whole character...
the problem is >30 years old
It's not. 30 years ago, the problem was different (110 to 1200bps?) Each time dialup modems got faster, the problem changed (you'll note that I'm being charitable making 1200bps available in 1985 :-)) We used to be happy with an autobaud that did 300-19200bps in two RETURNS (well, one, plus a second to make sure.) Then 56k modems with compression came along, and 115200bps became a popular speed (and also, modems could configured the serial speed separate from the modulation/etc anyway, so you just locked them to the top comm speed, and made sure you had hardware flow control.)
The usual problem is not so much that you can't figure out the speed of traffic coming in based on the traffic, but that you don't have driver-level support, and you have to guess based on the traffic you get THROUGH YOUR EXISTING DRIVER AND OS. After all, if you set the uart to max speed, you should get a unique sequence of characters and errors for any character at a lower speed. But most drivers will discard the errors, and very few will report them in-sequence with the data. (and, you may not have buffering turned on when those first characters arrive, causing you to miss some of them.