If you take a look in source the condition for this message is get_option('require_name_email')
. You can control it in Settings > Discussion > Comment author must fill out name and e-mail.
The programmatic way could be add_filter( 'pre_option_require_name_email', '__return_null' );