What C++ desktop editor, compiler and debugger to explore code ideas without having the hassle of downloading to a microcontroller?

This is primarily for investigating algorithms and data structures, not for hardware I/O.
Having a proper debugger is important as I really miss what you can do with Intellij based Java/Kotlin/Python style environments.

Also, it would be handy to have some kind of switchable 8/32 bit emulation mode to see what effects that has on the way things are stored in memory.

Platform is Windows 10 or Debian.

if you are interested in C/C++ programming try Code:Blocks which runs on Windows and Linux

there is a beta interactive debugger in Wokwi

you can pick an UNO or ESP32 for example so you'll have 8 bits or 32 bits architecture

Unfortunately still very much beta and essentially unusable even when trying to step through a simple example.

I installed CodeBlocks and the debugger keeps crashing. Seems to be a common problem.

You might give VS Code a look. I don't do a lot of native C++ programming in it, but when I do I find everything works without difficulties, including the debugger.

I'm using this extension to add full C++ support to VS Code:

VS Code is an excellent free open source editor/IDE for pretty much any language so there is a good chance you'll end up finding it useful for more than C++ alone.

The Arduino IDE 2.x UI is built on a framework based on VS Code, so you will find that you have been somewhat familiarized to the VS Code UI by prior use of Arduino IDE 2.x, and vice versa.