Add a query string to ALL links on site

As I understand your Question, you need to hook into most of the Link Filters (which are listed here: http://codex.wordpress.org/Plugin_API/Filter_Reference#Link_Filters ) and then add the query to them if the queryvar “clean” is set.

Happy Coding,
Kuchenundkakao