What is the best way to mimic a search query within a plugin

Pass the ‘s’ parameter to a new WP_Query object.

$mys = new WP_Query(
  array(
    's' => 'whatever',
  )
);

That should duplicate the default search.