Check if this solution work for your case:
add_filter('posts_request', 'supress_main_query', 10, 2);
function supress_main_query( $request, $query ){
if( $query->is_main_query() && ! $query->is_admin )
return false;
else
return $request;
}
posts_request
is the last filter called before running the query, and pass to you the $request
variable with the generated SQL string and $query
, with the WP_query object used to generate the query.
This way you can check if this is the main query, and return false to don’t run the generated query.