I have thankfully worked in mostly rational companies and been able to be honest with managers about what is or isn't working. At my last job though I spent more than a year saying repeatedly that I wasn't happy with my project work and that I wanted more pay. Annual review rolls around and they didn't fix it. I had a new job offer in a month and when I put in my notice my manager was shocked. He's a good guy but he was also my boss which means he's only going to pay me enough to stay. Just accept that fact and move on.
Match your notice period to the handover period - I'm sorry but everything about this section is wrong. Nothing you are working on is so important that you can't put it in a good state for someone else to pick up in your absence in two weeks. You stayed for 10 months? I can't tell if you or your employer was the one being strung along.
"Your new role, if you have one arranged, should respect your decision to be professional about your handover period. They’ll wait, don’t worry."
No - The hiring market for developers is red hot right now, no doubt about it, but potential employers are not going to sit around with a position open for months. Potential employers are not going to be impressed at your loyalty to a previous employer. They will think you are wasting their time and will probably be working to put someone else in that position while you dawdle.
The two weeks notice period is the conventional standard and everyone knows what it means. Stick to that and you'll be fine.