Lots of great advice in these comments. Adding a few bits based on my limited experience writing for O'Reilly:

E-books are important. They're more than half the unit sales in my case. Look for good e-book royalty rates. Someone mentioned 50% and I have no idea if that's realistic for tech books, but it should certainly be much higher than print. Some tech publishers participate in all-access online libraries, and you get royalties from these too when anyone accesses your book.

Toolchain is important. MS Word intake may mean you'll have less control over quality in post production. O'Reilly can do DocBook/AsciiDoc end to end, and can even push author-submitted ebook updates after launch. Of course if you prefer MS Word and staying hands off in post then great. But I'm always grateful for text markup in a git repo, enough that I'd consider it a big plus when picking from multiple publishers.

When you pick a publisher, make sure that you like their books and would be proud to have a year or two of your own work sitting next to them. Based on stories I've heard from author friends, there seems to be a correlation between production values and author happiness. Typesetting, paper quality, error rates, etc. are all things I care about anyway, and they're also a proxy for other parts of the experience like editorial and technical support. There are big publishers I wouldn't even consider because their catalog is so poor.

Once you start writing, don't stop. Find a steady pace and stick to it. Treat each chapter like a magazine article that's due at the end of the month. The biggest pain for my first book was writing for five months, pausing for two (weekends went to the day job for a bit), then feeling guilty about pausing, procrastinating, and nearly burning out from the stress. The work won't burn you out, the guilt will, so manage the guilt.

My editors were all good people willing to chat, answer questions, and connect me with resources. None of my editors gave me writing feedback. I don't know what's typical in this regard, but I felt quite on my own when it came to drafting and editing. I had mixed feelings about this at first: I was hoping to learn more about writing from an opinionated editor, as with magazine writing or fiction (I imagine). My editors were all good about pestering me for new material on a regular basis, which is a valuable contribution, and we had some good project planning discussions at the beginning.

Keep expectations very low for marketing help from the publisher, especially for niche titles, beyond the publisher brand itself and the occasional full-catalog ebook sale. Ask about marketing channels run by the publisher, such as companion videos, live streaming events, and publisher booths at conferences. Plan to self-promote online, and don't be shy about it. You're writing this book so people will read it, and they can't read it if they don't know about it.

Not sure if this is controversial, but personally I would trade some or all of the advance for a higher royalty. The advance doesn't come close to paying for my time, which means it doesn't shift the risk or up-front production costs to the publisher in a meaningful way. The case where I deliver a completed manuscript but the advance doesn't pay out is one I want to avoid: I want as many people as possible to read my book! If it's a failed investment for the publisher, it's a failed investment for me, even with the advance. One not insignificant advantage of an advance is that it usually pays based on drafting milestones, so it's a nice motivator, but that's merely psychological.