I've never actually used AutoHotkey much; I've always just interfaced with the Windows hotkey API directly. Since it's installed on my computer as a dependency for something else, I gave it a quick look-through to see if I could figure out how to disable Win + M and Win + D. It seems pretty straightforward:
1. Right-click on your desktop (or any other folder) and choose New -> AutoHotkey Script.
2. Name the file something like DisableMinimize.ahk.
3. Right-click the file and choose Edit Script; alternatively, open it in your text editor of choice.
4. Keep the existing text that's in the file, but add the following to the end:
#d::
return
#m::
return
This script will work just like a program. Double-click it to run it, or put it in your Startup folder. You can even right-click -> Compile Script to generate a standalone EXE.
> I also heard about Win + D, which could be what I'm hitting a % of the time.
Both Win + D and Win + M seem like pretty obscure shortcuts to be hitting by accident. Some touchpads and mice have gestures or buttons that minimize all windows, though; in particular, on lower-quality laptops, I've found that the "minimize-everything-and-interrupt-whatever-I'm-doing" gesture likes to fire randomly. It even used to happen a lot on some older Surface devices. Is it possible that's the issue?
> Correct me if I'm wrong: but positioning any window after minimization (possibly including the bottom show-desktop / taskbar area) will make it so the window settings can't be reverse back?
You'll lose the memory of which windows were visible, but with both Win + M and Win + D, their positions and sizing should be preserved. If a window doesn't restore to its same position and sizing when you restore it, that's most likely a bug in the individual application.