There might be more elegant way to do it, but from quick look at the code it seems quite easy to simply override the relevant option on login page:
add_action( 'login_init', function () {
add_action( 'pre_option_users_can_register', '__return_null' );
} );