To correct myself, the `\0` is only at the end, not after every line.
I tried using `\1` on macOS instead - the paste works correctly within Geany, the only problem is, that when pasted in other applications the final `\1` is included because the other applications don't know that it means block copy in Geany. Not sure if this is something we want.
I also looked at GTK clipboard API if we could store the block selection information somewhere but didn't find anything I could use.