I don't know if it's relevant to you, but I made something.
I am not sure what I did, but combining new methods from ReSprytile forum after your method, than going back to the old code in the same project fixed problem with crushes WITH activated UV menu from the old code.
When I start new project - it crushes immediately when enter Paint mode, however, I can use it with no problem in already existed project (I mean I don't know how, guess it something with data on project file itself).
Here is the empty (kind of) project and .py files that I edited
https://drive.google.com/drive/folders/1Lxuu4EC-_3q1ytZELdXi03BjWovNngqD?usp=sha...
P.S. Sorry for my English