Expand user home for cache_dir (#10051)
Currently cache_dir does not expand user home directory, which results
in counter-intuitive behavior when setting for instance
MYPY_CACHE_DIR='~/.cache/mypy/'
In this case a folder named ~ is created in the cwd where mypy is
launched.
This commit modifies the behavior and expands the ~ into the user home
directory.