If need to temporarily disable binary logs or set innodb_force_recovery you can set this in an environment variable instead of modifying the my.cnf directly, for example:

systemctl set-environment MYSQLD_OPTS="--innodb_force_recovery=1"

or

systemctl set-environment MYSQLD_OPTS="--skip-log-bin=1"

Then restart;

systemctl restart mariadb

To remove the environment var:

systemctl unset-environment MYSQLD_OPTS

To check the contents of the environment vars:

systemctl show-environment