Backport of CPython tarfile module (from Python 3.12)
