Fix Python utility compatibility issues - #29755
### Problem
Several repository Python utilities emit invalid escape sequence
SyntaxWarnings under Python 3.13.
The Java test checker also attempts to parse non-Java assets as UTF-8,
causing UnicodeDecodeError, and relies on a global parser instance.
The Apple build utility accepts malformed CMake version strings because
one version separator is an unescaped regex wildcard.
### Changes
- Use raw strings for regular expressions and replacement templates.
- Skip non-Java files in the Java test checker.
- Use the current JavaParser instance instead of global state.
- Require literal dots in parsed CMake versions.
### Verification
- Compiled every tracked Python file with SyntaxWarning treated as an error.
- Ran the Java checker against modules/java/test successfully.
- Verified valid CMake versions are accepted and malformed versions rejected.
- Ran git diff --check.
**Merge with contrib**: https://github.com/opencv/opencv_contrib/pull/3003
### Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
- [x] The PR is proposed to proper branch
- [ ] There is reference to original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake