A long time, years actually, never had any problems, i even tried disabling it to see if that was the problem.
Look for any file that his name include the text d3d9 in any subfolder of rFactor 2. And move to everywhere if you find any.
I do remember, that all our league members, that did use avast in the past, had to uninstall it to solve the problems caused by that AV software. Deactivating it was not enough, it had to be uninstalled. And it was the same with avira and sometimes also bit defender. Especially the free versions caused many problems.
I've had two different antivirus programs go a bit crazy, and two different firewall programs do the same. All free, but I wouldn't assume paid versions are immune to it. Uninstalling and reinstalling generally does the trick, except I think once when there was some sort of incompatibility - probably fixed in a later update, but I just moved to another package anyway. I don't think avast was one of those, and I've been using it the last 3 years without issue, but anything can go wrong. Certainly worth uninstalling to see if that's the cause, then can try reinstalling to see if it was just the install that was messed up.
I tried uninstalling Avast, same result, also tried uninstalling and reinstalling the game, no luck....
I solved my problem. I uninstalled the game, and deleted all things related to RF2 in my steam folder. All is well now. Thanks for all of the help!