Interestingly enough, it appears that it does happen sometimes even when not using the pen. I didn't notice it, I don't know whether the screen just didn't go black or the lid was closed, but it still shows up in Reliability Monitor with the same HeatCore.dll issue.
The reason why I noticed is that there is another effect of dwm.exe crashing: Microsoft Teams (and sometimes some other Electron-based apps ... maybe) go black (but only sometimes), so I have to restart it completely in order to use it.Anyway, according to MS support, their technical department should get back to me in the next couple of days, MAYBE they come up with a fix. Hopefully.
Fingers crossed.
My problem remains, at least once a day, the first time my pen touches the screen I get a DWM crash.
Source
Desktop Window Manager
Summary
Stopped working
Date
4/23/2021 9:37 AM
Status
Report sent
Description
Faulting Application Path: C:\Windows\System32\dwm.exe
Problem signature
Problem Event Name: BEX64
Application Name: dwm.exe
Application Version: 10.0.19041.746
Application Timestamp: 6be51595
Fault Module Name: HeatCore.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 54ab4a1a
Exception Offset: 0000000000035b5d
Exception Code: c0000409
Exception Data: 0000000000000002
OS Version: 10.0.19042.2.0.0.768.101
Locale ID: 1033
Additional Information 1: b111
Additional Information 2: b111fda7573a1e10441015376b653053
Additional Information 3: f2cb
Additional Information 4: f2cb04e9d7bee3b9ba950fa6b38410fa
Extra information about the problem
Bucket ID: 3af1b524c9df8794d117428742533340 (1231526171809887040)