$CFG->autologinguests='0';
$CFG->guestloginbutton='1';
$CFG->allowguestmymoodle='1';
Could set all above to '0'. No need to restart any service, just browse to site.
There are many places in config of site related to guest.
Suggesting using Admin search for 'guest'.
https://yoursite
/admin/search.php?query=guest
'SoS', Ken