Python handles astral characters, it's just another name for the 32 bit chars.

We should never encounter lone high surrogates as they will only ever appear if the user is super douchey and puts a high surrogate directly in with the escape code which will never be needed as python supports the full range anyway and doesn't let you work with usc-2 pairs directly. We should never skip characters though, if it fails to register as a pair we should just put in the high end anyway.

As far as the final else if < 0x10FFFF goes that is meaningful as we should try to swap over to ES6 codePointAt which does output the higher values at some point. Unfortunately we'd need a shim for it to achieve non-firefox support that I haven't bothered doing yet as it was not needed. It will all be improved when I fix up the string type anyway.