Apparently kmod-31 does not really work with kernels that set MODULE_COMPRESS_XZ: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050582 According to the debian bug they switched to the in-kernel XZ implementation with v31, but the in-kernel XZ implementation has some severe limitations that make it unable to deal with larger modules. From what I've read so far, other module compression algos should be fine, but haven't tested it, yet.
Added a kernel lore link that mentions a kernel patch which should remedy the situation.
Not disputing the bug at all, I just wanted to note that I use MODULE_COMPRESS_XZ on two machines and nothing exploded there, which is curious. Thanks for the report - someone had made a reference to kmod-31 not working but didn't give any more detail and I couldn't figure out what was going on there.
mpagano put https://gitweb.gentoo.org/proj/linux-patches.git/commit/?h=6.5&id=51bcb2538941016f4ebd47dcc0c878f26a105a0c into genpatches so we should be good now.
ftr, got fixed anyway but see there was problems reproducing the issue here and, while looking at similar bug #920837 I couldn't either. It turned out need to set CONFIG_MODULE_DECOMPRESS=y. It's also not a default ("if unsure, say N"), nor is it set for gentoo-kernel I can see, and kmod-31 NEWS mentions it needs kernel >=6.4 to work. So it should only have affected a few people in ~arch that manually enabled it. Wasn't clear to me at first given I didn't know the option existed (thought only needed XZ decompression support), so thought I'd note it here.