If you really want to put binary data on Twitter, why not encode it in an image? You could probably get several tens of kilobytes of binary data reliably encoded in a JPEG of the maximum size Twitter allows.
Twitter seems to allow PNGs so might as well use that instead and not run into JPEG compression issues.
Twitter will mangle your PNGs into JPEGs unless they have an alpha channel.
Aren't JPEG's lossy? I can't think of a reliable and performant way of retrieving data from a JPEG.
On compression yes but you can craft a jpeg image which has exactly the pixel data you need. It will fail if someone recompresses your image, but that would be unlikely
Not unlikely at all, if you're going to post it on social media
Twitter recompresses images, as do most networks.
Two or three bits per pixel, grayscale, should be quick and pretty resilient. A hundred kilobytes or more is easy to transfer.
Or, how about a QR code?
If you want absolutely terrible density, sure. Still beats 140 characters.