It may be useful for SEO: avoid having two pages with different parameters displaying the same (duplicate) content.
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} . [NC]
RewriteRule .* - [r=404,L]
Tested on Apache2. It will cause the server to issue a 404 response only if there is something after the "?" character in the URL. It can also be extended for example if only some of the parameters should trigger the 404 error.