I've had the carpel tunnel relief operation on both hands. I spent about a year trying every other possible medical treatment, taking time out, changing action, set up, technique etc... It was the most stressful thing I've ever dealt with. As a professional player it was made even more complicated. I also play bass guitar and toyed with the idea of giving one up, but it happened on both instruments.
In the end I had both hands done at once and it was a great success. All the other treatments just gave short relief, but the operation was amazing. I was VERY concerned about an operation on my hands, but I wish I had done it on day one and avoided 10 months of stress. I've also met several other musicians who have had the operation & got great results.
Any operation involves risk, but a lot of the general public have this done so it's a fairly routine procedure.
Of course its also worth seeing a teacher and playing to other bassists to see if you are doing anything unusual that could be causing it. It's all about straight wrists.
Perhaps try other instruments. I have a bass guitar playing friend who only gets it on one bass guitar. New bass, problem solved.
I would suggest seeing more than one doctor and be sure it's carpel tunnel, not a nerve problem etc...
Of course I would recommend trying other treatments first, but if you need the operation don't be unduly concerned (like I was).
Good luck with your recovery.
Geoff