But actually, while looking at this, I understood more about what the print_escape_nonascii flag is used for (i.e., multibyte vs unibyte stuff), and I no longer think it makes sense for it to affect printing the NUL byte anyway. I propose adding a new flag print_escape_control_characters instead (see patch #3 in the series). I also implemented hiding the byte code functions with text properties in #4. It's not quite satisfactory though, because it doesn't cover byte code functions values that are arguments, only byte code being called. I think printing needs to be made more flexible in order to cleanly catch all byte code values. Patch #5 replaces NUL bytes with "\0" in X selections (I guess it covers w32 as well? Haven't checked yet).