Python 3.13 introduced usage of mrc instructions via inline assembly: https://github.com/python/cpython/blob/main/Include/object.h#L195 https://github.com/python/cpython/blob/main/Include/internal/mimalloc/mimalloc/prim.h#L172 https://github.com/python/cpython/blob/main/Include/internal/mimalloc/mimalloc/prim.h#L199 This seems to work ok in qemuarm (I didn't specifically confirm that these code paths are executed though), but in qemuarmv5 it throws 'Illegal instruction'. It isn't clear if qemu makes incorrect decisions, or the instruction as specified by python is indeed not universal on arm hardware. For now, I was able to disable the use of it via disabling mimalloc feature on armv5 targets.
Filed upstream at https://github.com/python/cpython/issues/125444.
Upstream has now resolved this issue in the 3.13.x branch and we don't have 3.13.0 yet. Closing as filed upstream, we'll backport the fix for the upgrade.