Even worse, foo(a,b) could call bar(a,b,c) which calls foo(b,a), all without otherwise looking at a or b. This could get really bad really fast.
But that feels like the wrong way to analyze this. Even though a full solution isn't practical, a limited one may be.