It may be useful for SEO (something about duplicate content).
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} . [NC]
RewriteRule .* - [r=404,L]
Tested on Apache2.
It will return 404 only if it is something after the "?" character.
It can be extended for other purpose to match only some of the parameters.