Extract TWRP backups made with adb
I have found that TWRP-generated .ab files are different from the normal adb backup files, so the offset is different from normal .ab files. I was able to inspect and extract files using (for example to inspect) the following command:

dd if=backup.ab bs=512 skip=1 | tar ft -


Apparently, the header may be longer, but it should be aligned with 512-bytes boundaries, so just bump the skip= parameter if it can't find it at first.

Note that the file format is defined in twadbstream.h, if you need to dig into this further.