To avoid the issue of queries with IN() polluting pg stat statements, one can in most of the case replace
WHERE a IN()
With
WHERE a = ANY()
No matter the number of options in the ANY operator, it'll hash to the same query id. Semantics between ANY and IN are very slightly different, but 95% of the case it'll get the job done and provide better stats (by having all queries analyzed together).