Space Indenter
I find spaces to be a bit easier to manage on the mobile (compared to tabs, which I hold in respect), so I looked for a solution.
This plugin exposes CodeMirror's relevant settings to Joplin users, which enable switching between tab indentation and space indentation. In addition, it can automatically reformat your notes (if enabled in the settings) and convert any existing tabs to spaces (or vice versa, if you decide you're a tab-person after all). A dedicated toolbar button calls the same action manually.
AFAIK replacing tabs with 4 spaces is OK as far as CommonMark is concerned, and in practice most things work as expected even with 2 spaces. If there are caveats to this approach, please discuss below.
Thanks to Rich Markdown (@CalebJohn), that heavily influenced this implementation.