This question asks about two distinct problems, with different remedies.
Problem #1: "Mathematica Pure Function Scope Problem"
I encountered this problem in a non-trivial body of Mathematica code and it took me hours to isolate it and fix it. I reported the issue to WRI at the time. They acknowledged the bug and suggested that the work-around is to avoid the use of named arguments in pure functions. That is, rewrite Function[{x, y}, ... x ... y ...] as ... # ... #2 ... &. I now avoid named arguments in pure functions like the plague on account of the trauma of the whole experience.
At first this sounds like an old joke (Patient: It hurts when I do this. Doctor: Don't do that.), but I find in practice is rarely causes me any grief. The rare exception is when I wish to nest two pure functions and want to inject a value into the inner scope (for examples, see (16947) or (38393)). The usual work-around is to use named arguments, e.g.
Function[{x}, ... Function[{y}, ... x ...] ...]
but since this is plague-infested I usually just create a regular (non-pure) named function or look for an alternate technique such as using replacement rules. Again, I emphasize that I find such cases to be very rare.
Problem #2: Free Variables Within Function Definitions
The second problem from the linked question concerns the errors arising from the following expressions:
f[a_, b_, c_] := Integrate[E^(-x^2 - y^2), {x, -a, -a + c}, {y, -b, x - b + a}] / Pi Plot3D[f[x, y, 10], {x, -3, 13}, {y, -3, 13}] (* ... many errors ... *)
In this case, the problem lies with the definition of f. It references the free variables symbols x and y. When the function evaluates, these symbols will take on whatever values they happen to have in the enclosing scope. In the case at hand x will take on various values between -3 and 13. But Integrate wants x to be a variable name, not some real value. Hence the errors.
The fix is to use Module to localize x and y:
f[a_, b_, c_] := Module[{x, y} , Integrate[E^(-x^2 - y^2), {x, -a, -a + c}, {y, -b, x - b + a}] / Pi ]
(but note the comments on the linked question: this multidimensional integral is computationally expensive to evaluate and one would be wise to find another method to perform the integration)
I think it is fair so say that most users are surprised sooner or later by the need to localize the integration variables in Integrate and the iterators in functions like Table, Plot, etc. This issue is discussed at length in (94061) and (126683), including discussion about the Mathematica design decisions that make such localization necessary in the first place.