There’s a filter, wp_count_comments, that might do what you need:
add_filter( 'wp_count_comments', 'wpse_404619_maybe_disable_comments', 10, 2 );
/**
* Disables comments on certain pages.
*
* @param array $comments The page's comments.
* @param int $post_id The page's post_ID.
* @return array The filtered comments; empty array to disable.
*/
function wpse_404619_maybe_disable_comments( $comments, $post_id ) {
// Sets the list of page IDs with disabled comments.
$disable_comments_for_these_pages = array( 1, 2, 5, 6 );
if ( in_array( $post_id, $disable_comments_for_these_pages ) ) {
// Returns an empty array to disable comments.
return array();
}
return $comments;
}
This code is untested, but hopefully it’ll provide you a starting point.