Which is of course not exactly blazingly fast.... That ROM function needs to scan through the whole character set worst case.
Not so slow, if a match is found on the first byte of the character, then its next line will be compared. If not, the next character. This task is fast on Machine code.
I think this is probably what the Spectrum does as well with the SCREEN$ command. The Spectrum display is not a text buffer either. It's an attribute-based graphical display.
I have suffered editing Spectrum basic lines a lot..... It was my first computer. Imagine the release I felt when I started to do(editing) it on the EP.... (The Spectrum is)Good for some things only.