Academia options as an autodidact?
The problem with academic outsiders is that you cannot judge their abilities. Having a Ph.D. does not mean that you are good, and having none does not mean that you are bad, but there is a strong correlation between degrees and competence. If you have neither a degree nor published work I have only your word that you actually know anything about CS or astronomy. At the same time for every position there are dozens of applicants with a degree, publications, and recommendations, so your chances of getting this position are practically 0.
So the first question is whether you need the income from a position, or do you have some other job providing you with a sufficient income? If you need the money, you almost certainly need a Ph.D. The only exception I could think of would be that you publish remarkable results. But then you can turn these results into a Ph.D. at no further costs anyway.
The second question is how much resources you need for your research. In mathematics and CS a lot of serious research requires nothing but a computer for typesetting. In astronomy you might be able to run over existing data or do simulations without much costs, but it is more likely that you need computation power beyond your financial means. If you need access to observatories, you run into serious trouble.
So if your planned research requires some outside input, and you do not get a degree which allows you to successfully ask for this input, you have to become known in some other way. Start with problems which require no resources, publish results, give talks at conferences, talk to people privately at conferences. Once you earned some respect, it should be a lot easier to get help with your projects.
There is another aspects of degrees that drives the need for a PhD. This has to do that the main property of a PhD is that it is a philosophical doctorate, it teaches you how to think and approach problems in a very particular, highly structured way. Masters and BSc degrees do this somewhat, but to a much lesser degree.
While it is reasonably easy for someone very talented to learn to think in a BSc way, it is much harder to do so independently for a doctorate. It is possible, but uncommon, and most cases involve people who dropped out rather than never started.
Note that this says nothing about subject skills. Subject skills, such as programming, can very well be self-taught, although guidance is very helpful, especially to gain more conceptual understanding faster. Data science often involves a large amount of trial and error with well-defined tools. Large aspects of that are primarily skills (but do require some degree of advanced understanding).
I agree with the prior answer, but have some further points on the relationship between programming and astronomy, and on the community college route.
If you wanted to do paid, supported research in computer science, you would need a PhD just as much as to do paid, supported research in astronomy. A PhD is the easiest way both to learn to do research and to demonstrate that you can do research. Programming in itself is different because it is a practical skill distinct from research.
After retirement, I took a community college Latin 101 course just for fun, and I volunteer with a community college robotics group. The good news is that you will have some bright, motivated, fellow students. The bad news is that you will meet some students who are just going through the motions, and are not really trying to learn.
You may find some of the courses you have to take boring, but you are presumably more mature now than when you were in high school, so you should cope better. Aim to do work at a much higher standard than is demanded for the course. That will help you concentrate, and equip you for transfer to a four year school.