Well, you said:
so I suspected that there may be some words longer that the 64 byte buffer allocated in readline. But. I’ve now discovered there aren’t any long words. Whatever the problem is in readline, it’s not caused by words longer than 64 characters.
What makes you sure readline is the culprit?