How can one uninstall Avast totally from the machine including registry keys, files etc, to install a newer version of Avast or any other AV software, as if it was never installed in the first place?
You can uninstall it from the usual place - Control Panel / Add/Remove Programs.
And, there is certainly no need to uninstall avast! before installing a new avast! version.