Well, let's start with the real problem. Been a "bug" since Qt4. A small discussion can be found here. In true Qtc fashion the bug was closed with this comment:
This is easily done by users implementing their own selection based on
their own criteria
And zero examples of how to do that, back in 2009. Since then Qt has adopted Unicode Word Boundaries. They have also doubled down on the reprehensible coding practice of putting everything anyone would want to change into internal private classes. Here is the snippet from QTextCursor

Some PyQt developers claim to have hacked around it here. That will do you little good because someone got the bright idea to make select() use an enum since then.
If you are using Qt6 you are beyond screwed or so it appears. I can find no official Qt6 version of qtextengine.cpp. Most people, including myself, stopped using Qt over the past two years due to things like this.
Your "solution" is to create a custom QTextEngine class and make your QTextCursor use it in the layout. You need to override this hard coded fiasco to always return false.

Your second "solution" is to install an eventFilter(). In it you must trap all events to the QTextEdit that might select/move a word, and handle them yourself.
Your third "solution" is to create a custom QTextEdit class and override the default event() handler. Again, you must trap every keypress/mouse/whatever event that might select or move a word.
DO NOT try to take a shortcut and map onto selectionChanged() signal. If someone tries to select 3 characters with mouse/keyboard you will force it to a full word.
When overriding events or filtering them be absolutely certain you replace the QTextCursor in the edit widget.

Many people chose to create a custom QTextEngine over the years because it was one place to fix it all. Umm they were also building from source. They built a custom Qt library after changing the QTextEngine class. Most added a property like
bool enableUnicodeWords;
If true, the offensive method worked as-is. If false it always returned false. Customizing the Qt source requires you publish said customizations somewhere. No I didn't find any published with a quick search.
This has been a problem since at least 2009 and because it impacted only desktop applications, it was ignored. Qt spent the past decade plus focusing on phones and QML to the detriment of all else.