Not the most important optimization, as these functions aren't used much, but came across this when reviewing #17808 and as I had this already implemented years ago when developing my own embedded / real-time libc, decided why not to send a PR here.
ASCII was designed clever enough so that you can convert from lowercase to uppercase and vice versa by just flipping a single bit instead of doing addition and subtraction. Maybe some comment could be added about this, but I think it's a well known bit hack. In addition, adding const to parameter will not hurt, at least in my tests it made code smaller.
Also noticed that ToUpper() is only used in unit tests and nowhere else, but it makes sense to keep both functions, probably it will be useful someday in future.