The concept of job security is completely moot if you don’t want the jobs that a particular degree “secures” you. Yes, there is a physician shortage in the U.S. today, and yes, MDs are virtually guaranteed jobs no matter where they live. That doesn’t matter if you don’t want to be a physician! The “guaranteed jobs” are primarily clinical roles - providing care to patients. If you want to do research, then you jump right into the competitive pool with the PhDs - the only difference being that there are clinical teaching positions at medical schools that you can fill that a PhD can’t necessarily.
I left academia for a position at a corporation in industry myself. There are politics everywhere. Some universities are better than others just like some corporations are better than others. But going to industry doesn’t mean escaping politics. It’s just a different kind. (My company is an enormous bureaucratic machine. There are LOTS of politics. It’s just that I expected and am more willing to deal with the politics here than the ones in a university setting. So far.)
That said, “MD or PhD” are not jobs, they are degrees. A person with a PhD in cognitive neuroscience could do a variety of things besides academia. Some PhDs stay in academia but choose to remain research scientists/associates instead of pursuing tenure-track jobs - so they join other scientists’ labs in support roles. The PI is the one who chases the grant and the research scientist/associate performs other research tasks. However, those jobs are usually soft-money (they rely on the PI getting the grant, although in many research centers that’s kind of a given). These jobs used to be intended to be temporary, but increasingly I’m seeing people do them for several years after a postdoc for indefinite amounts of time. I have several friends who moved into research scientist/associate positions after a year or two of a postdoc. One friend was a research scientist for I think about 7 years before pursuing tenure-track work. Another friend is coming up on what I think is her third year as a research associate in the same center she was a postdoc. The pay is decent ($60-75K+ depending on the institution), but I’m not sure I would advocate getting a PhD with the goal of becoming a research scientist/associate in an academic center. Even the ones I know who are in RS/RA positions do it with the intention of eventually becoming tenure-track professors or at least PIs at national laboratories or think tanks.
If you want to continue to do research in cognitive neuroscience there are companies and organizations other than universities that do that research - some think tanks and nonprofits, Department of Defense laboratories, private pharmaceutical and biotech companies. Then there are related fields - jobs in which you won’t do cognitive neuroscience research but might do some social science or life sciences research. I’m a user experience researcher at a major technology company; my PhD is in social psychology but I have co-workers and colleagues at other companies who did work in neuroscience. Some go into data science if they have the computational/statistical chops. Some of those biotech or other health-related conglomerates may need smart life sciences PhDs to do general stuff.
But there are many other careers that you can get - some very science-related - without getting a PhD, even if you are interested in research. There are sooooooooo many applications of CS to the health and life sciences. Bioinformatics (or biomedical informatics) sounds perfect for you. A bioinformaticist - someone who develops methods and software tools for understanding biological data. You can do that with a master’s. You may also be interested in epidemiology or biostatistics, particularly in applying computational modeling to these fields. (Epidemiologists model disease trends and help track and prevent diseases across populations; biostatisticians use statistical models to analyze health-related data. Both jobs require an MA/MS or an MPH.) You could work for a hospital, clinic, health insurance agency or other health organization as a software developer, helping to develop and maintain systems for medical record-keeping or diagnostics or something else. That would require an MS probably. You could go into data science if you took some extra coursework in statistics and mathematics and beefed up your machine learning, but work as a data scientist in biotech or for academic medical centers. You could do research administration or lab technical work for academic medical centers - like project coordinator roles or master’s level research associate roles, especially for pharmaceutical companies or medical centers on clinical trials - those generally require a master’s as well.
Personally, my recommendation is that unless you know you want to be a professor OR you can find evidence of a very robust market of jobs that you absolutely want to do that require a PhD…don’t get the PhD. It’s time that you can spend building experience in the field, which is usually more valuable for moving up. But at the very least, if you are unsure, PLEASE take the time “off” after college to explore some other career fields for 2-3 years and make very sure that you want a PhD. With a Johns Hopkins degree in CS+NS I’m sure you will have many options available to you!