Heap corruption on Windows

The windows build and locale are key to replicate the defect. On Windows 10 1809, with latest Python we can constantly replicate it, but not from 1903, 2004 or later editions.

Found this post:
A few more Windows locale-related remarks - Discuss wxPython

On following up, I did find few defects reported in Python and looks like the fix came from Windows UCRT team. But I did not find any official statement in any release notes.

just removing asctime from Log formatter gets the script working on Win 1809. Time formatting is a locale aware operation, and calling that after wx.app Init will crash.

Robin’s solution from here worked in my case.
wxPython4.1.1 Python3.8 locale wxAssertionError - Discuss wxPython

I’m not sure if its future proof, as it could break with Windows / Python changes