I use notepad++ to get rid of them. (god how I hate them too). I use CubeMx to create the file and then thats it, I never (need to) go back. If I do miss something then I create another project with the extra bits I need.
Once Cube has created them, open the file (eg main.c or any of the generated files) in noptepad++ and do the following. Note: the 'replace' field is empty or a space, depending on what it allows. Ensure regular exp is on too.
find: ^.*\/\*.*USER CODE.*$
replace:
-------------------------------------
and also to replace /* commment */ with //comment
find: (^.*)\/\*(.+)\*\/
replace: \1// \2