TIL that the old mbox format (one of them anyway) handles deletion by... rewriting the entire mailbox without the deleted messages. I guess Idk what I expected: https://github.com/python/cpython/blob/3.14/Lib/mailbox.py#L704-L770
Oh, and this impl has a fun side effect- you can fail to regain the lock after rewrite. I guess an existing lock granted by flock dies after a rename()?
