input() and readline can, however, deal with history items that happen to be multi-line due to embedded \n characters. The MultiLineReader class takes advantage of this. If a line of input is terminated by a continuation string (e.g. \), then an additional line of input is requested. This continues until a line is provided that does not end with the continuation string. MultiLineReader.input reads lines until it detects one not terminated by a continuation string, and returns those lines concatenated into a string (removing the \ and \n terminating each non-terminal line).
History items are correctly maintained, replacing multiple continued lines, with the one joined-together line. When one of these multi-line history items is edited, it shows up to the keyboard dude as it was typed in originally: multiple lines, with all but the last ending in the continuation string.
The repository is here: https://github.com/geophile/multilinereader.
No license yet, but I'll pick a very liberal license allowing you to do what you want with this software.