Please point out where I'm wrong, I don't want to jump into something that I'm not capable of.
I embedded a bunch of links along the way, but perhaps
this one, by Big-Mess-O-Wires, which details the hoops that he went through emulating the IWM for his Mac-in-an-FPGA project is... the most straightforward. (I put it in before but perhaps you missed it.) I know "it encodes GCR from a straight data feed" seems like it should be a reasonable explanation of what the IWM does, since most other disk controller ICs *do* accept straight data bytes and completely transparently convert them to FM or MFM encoding on the other side, but... that's just not what it does, according to every in-depth manual on programming the thing I've read. It is *annoying* that basically all the references seem to delight in completely glossing over the "you need to encode the data" part, but it's there, really, I swear.
#1: Read Big-Mess-O-Wires page. He's not talking about encoding grabbed from the "outside" of the IWM, he's talking about puzzling how the encoding is done in software in the Mac ROM...
#2: I know it sucks, but
Read this assembly source code for the NetBSD driver for the IWM chip. It's very well commented so you don't need to be able to program in 68000 assembly to read it. You can read the translation table, and you can follow the parts of the code that actually do the disk I/O to see how the bytes are transformed. (IE, three 8-bit bytes get stripped down to six bits, and are converted to 8 bit bytes with no more than two zeros in a row according to the "toDisk" translation table. Then the three 2-bit leftovers are combined into one 6-bit nybble and translated via the table.
Three plaintext bytes get converted to four GCR bytes via a software routine. A reverse conversion table is also needed to convert data coming *from* the IWM back into regular bytes, and it doesn't match, on purpose.
(One helpful thing that's noted in this driver: the GCR translation table for MacOS is different than that used by Apple ][ ProDos. So while reading the Apple ][ DOS manuals will tell you the theory, you need to use translation tables lifted from the .Sony driver for the actual conversions.)
Again, I know, it's completely counter-intuitive. Given all the gushing love there is out there for the super-clever Woz disk controller you'd think it was a hardware miracle that was easy to use and did all sorts of magic for you, but it's actually little more than a bidirectional shift register and a very minimal window-based data separator. Everything that makes it work is software. It does *not* encode GCR.
That *all* said... reading the data sheet *again* (which isn't very good) and looking at a Q&A about how the Disk ][ controller works... I'm slightly less certain you *absolutely* couldn't shove data through the IWM that doesn't obey the "no more than two zeros in a row" rule, but I'm far from comfortable with saying that's *not* true. The input side of the IWM, as noted, is a window-based data separator, in which a "time window" for a valid read is opened by the trigger of the last valid bit read, and it's not completely clear to me what would happen if you went too many periods without a zero-one transition. I *swear* I read another document that claimed that the data in the output register would be invalid if that happened (it seemed implied that the IWM would stop reading until the register was cleared at the moment the rule was broken), but I can't find that document so I guess I can't absolutely *swear* that what I read there wasn't actually saying that the routine that grabs the byte off the IWM and checks it against the nybble translation table wouldn't be responsible for failing the byte for not matching the table. *IF* that's what it meant... then maybe you can just yoke two IWMs together and send plain-text through them. It's breaking the rules, but the documentation for the IWM is so bad I can't swear if those rules are hardware enforced in it. The floppy disk routines would have kittens over three zeros in a row, but... someone *really* needs to stare at a disassembly of the the Mac Plus version's of the .Sony driver and figure this out once and for all. The DV17 Sony Driver tech note says what part of the Mac Plus's version of the driver would be called if it were communicating with an HD-20, if there's *anyone* out there able to stare at that and see if that part of the driver uses or skips the GCR translation table calls then the mystery is solved.
But... the IWM does *not* encode GCR. *Please* note I'm not saying this in an attempt to discourage you, by any means. It's just important to understand that *if* GCR-style encoding is a necessity for the IWM to successfully read a data stream on the serial side (which I'm now... not certain about) you're going to get discouraged waiting for "plain text" bytes to appear on its data port. The software for doing the translations isn't that horrible, so if you need to do it shouldn't be a deal breaker for something of this magnitude.