I do it using a $400 Prusa Mini and epoxy resin: https://alexbock.github.io/blog/3d-lenses/index.html
It's surprisingly easy to 3D print the shape of a lens and polish by hand. I made a working telescope this way with a 3D-printed body and two cast epoxy lenses. As an added bonus, you can easily make aspherical lenses this way.
If you coat the surface with silver you can also make mirrors, but the polishing requirements for this are a lot more difficult. My attempts at a 3D-printed telescope mirror have very bad image quality compared to the excellent results from the lenses.