try a diognostic startup
in windows, open the start menu, type in the search box
msconfig
open it, select 'diognostic startup' and apply, this will disable everything that is not needed from starting up, like safe mode.
if your having a issue starting up in safe mode, there may be another cause to the problem because Avast shouldnt start in safe mode as it's a basic startup option.
if your having booting issues, keep pressing the F8 key on startup, dont select safe mode, select 'last known configuration that worked'