There are stable research positions, but they tend to actually be high-prestige and hard to get, like faculty member or permanent fellow at a research institute (Institute for Advanced Study and the like). In some fields you may also be able to find research positions in industry, or at a national laboratory, and those options are pretty popular, where they exist. A really well-funded lab that can string together enough grants to insulate the research scientists from the money flow and provide them de facto permanent jobs can also be such a place, e.g. the heyday of the MIT AI Lab, which had many non-faculty researchers. Also a popular option when it exists, but fairly rare in CS (more common in areas like medicine).