So I have had weird segfaults with DNF lately and both DNF and RPM are outdated so it'll probably be fixed when they get updated. But just when I was sniffing around I found out that there's a new DNF incoming that will eventually replace the old one. And cauldron already got it packaged. I've been testing it now for a few hours and it seems to work just fine. You just use it as "dnf5" and almost all the old switches will work. Good work of the package maintainer to package it so early.
Added it to the wiki page. https://wiki.mageia.org/en/Using_DNF#Next-generation