I slept with mine every night for the 6 months we were on the boat in 2018, most of which was at anchor each night. There are better options than planning for, buying, installing, and maintaining an inverter, in my opinion. Why not plug into 12V DC, which is what I did?
In fact, in preparation for moving onto the boat, I purchased a gently used, refurbished Respironics Dream Station AutoCPAP from the amazing folks at secondwindcpap.com. I chose this unit based on recommendations (see a wonderful website below), how much current it drew, and the price of the available 12VDC cord (which was only about $25, instead of the $100+ for the 12VDC cords for other manufacturers machines). I could use it about 3 nights without drawing our 2 house batteries (2 X 160 AH) down enough that I wanted to run the engine to recharge the batteries. YMMV, as all of our lights were LEDs, and we our only other current draws were recharging phones and running computers (on 12VDC) while at anchor.
There are threads about CPAP use on cruising boats on the following website (and the search function is easy to use):
I found the site very helpful, and the folks at SecondWind were wonderful. Their customer service is unparalleled. As to costs, I think I paid about $400 for a (then) state of the art auto-titrating CPAP. And all I did was plug it in - easy. Don't know what your all-in costs would be on the inverter and install, but for me, the decision was easy. Of course, it helped that I needed a new CPAP, mine was 8 years old at the time. I didn't involve my medical insurance, just paid out of pocket. Cheaper and quicker.
If I can help in any way, send me a PM and give me a day or so to respond, as I am out of the country.