I am not "the owner of the absolute truth", so I'm going to say this from a humble position, and I might be wrong.
I think you are "playing with fire" here. The defaults for TEMP and TMP are the ones you HAD.
For a clean complete uninstallation of Avast, you need to run the specific removal tool from Windows Safe Mode, indicating in the removal tool the correct installation folder and version(s). You need to reboot into Safe Mode for each version of Avast you ever had, so to really remove all relevant remnants.
Before reinstalling, you can delete all temporal files / folders related to Avast, manually and under Safe Mode if possible.
Then you need to download anew the latest stable setup.exe for Avast, install as administrator (right-click -> "Run as Administrator") and reboot immediately after the installation finished (no testing, no checking, no scanning, "nada" before reboot).
Whichever the reason for the old temp folders of Avast, or the current accumulation of "too many" temporal/older files related to Avast, I seriously doubt that changing the traditional TEMP folders is the solution. It might had been, if it was the other way around (using TEMP folders other than the traditional).
Of course, this is your system and you are free to try whatever you want.