Prevent WordPress automatically processing certain URL queries

You should find alternatives, as noted on the codex article of “Reserved Terms” in WordPress (emphasis mine):

There is a complete set of reserved keywords, or terms, in WordPress
that should not be used in certain circumstances as they may conflict
with core functionality. You should avoid using any of these terms
when
:

  • Passing a term through a $_GET or $_POST array
  • Registering a taxonomy or post type slug
  • Handling query variables

You could use ?search= in place of ?s= and ?pg= in place of ?page= for example.

Or, depending on what exactly you’re doing, you could create a custom rewrite rule with add_rewrite_rule() and then you could name the underlying query vars whatever you wanted.