I'm a bit confused on your comments here.
You state "I often do intermediary commits that don't compile ... to make sure that I don't lose the code"
And follow that with "I want every commit to compile and be testable individually."
I'm the same as OP. I commit constantly when hitting a natural stop point or when taking a break and push up to my branch/pr. I hate having code locally that hasn't been pushed to the origin.
But doing this means I have many commits that don't mean anything or are unfinished and in an uncompilable state.
So I git rebase and massage the history to make more sense.
I mean that I do many small "crap" commits while developing, once I'm ready to merge into the main branch I clean the history to get proper, atomic commits.