user_home_dir() assigns 'env = getenv("HOME")', but on Window that's immediately followed by 'env = getenv("APPDATA")', i.e., it doesn't use value of $HOME for anything. Either it should consider the value, or not to get it at all.
Likely makes to sense to rewrite it so that also the log messages refer to correct environment variable. Currently they speak of "HOME" even when it's "APPDATA" in reality.
user_home_dir() assigns 'env = getenv("HOME")', but on Window that's immediately followed by 'env = getenv("APPDATA")', i.e., it doesn't use value of $HOME for anything. Either it should consider the value, or not to get it at all.