How to reset MariaDB into a "fresh install" state?
MariaDB can be reverted to the fresh state by removing its data files.

Say if you run MariaDB on a Debian you can do the next:

systemctl stop mysql
rm -rf /var/lib/mysql/*
systemctl start mysql


At the start if no datafiles exists MariaDB will recreate the internal scheme mysql.* with all default values. All leftovers like config and log files you have to clean up by hands.