Open a URL with parameterized query arguments (URL-encode)

Solution 1:

You have lots of requirements, which makes for a slightly convoluted solution:

open fafapp://find?loc=$(python -c "import urllib, sys; print urllib.quote(sys.argv[1])" "$path")&inp=$(python -c "import urllib, sys; print urllib.quote(sys.argv[1])" "$what")

This uses python, which is pre-installed on macOS 10.11 and later (including Big Sur). It is also a one-liner (although a long one).