Mason doesn't work out of the Brew box on Linux

That only works if you have Python 2 installed. The Python code /home/linuxbrew/.linuxbrew/Cellar/chapel/1.22.1/libexec/util/chplenv/printchplenv.py starts with:

#!/usr/bin/env python