You can try adding these rules to the htaccess file in your document root, ideally above any other rules you may already have there:
RewriteEngine On
RewriteCond %{HTTP_HOST} \.com$ [NC]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^$ - [L,R=410]
You can replace the R=410
with a R=404
if you'd rather have a "Not Found" response.