It's quite unusual for a ML Python code to cause a BSOD error on a newer and more powerful system.
Outdated or conflicting drivers can sometimes lead to instability and crashes.
Monitor memory usage using tools like Task Manager.
Ensure that you're using the latest stable versions of Python.
Run hardware diagnostic to check the system.