Apple has ways to help provide software and maybe even hardware for students interested in programming. Google it or search for it on the Apple web site. You could also ask about this at an Apple store.
You may even be able to just go to an Apple store and program there on their computers. I think as long as you're clear about what you're doing and get to know the employees, you could use their best machines and Xcode for free. Anyone can check their e-mail at an Apple Store. I've even read stories of people doing job searches at an Apple Store, writing their novel on the machines there, etc. If it's macOS or iOS software, I think they would be more than willing to help.
Your local library may have an Apple Computer with the software for you to use free.
You could also find refurbished or second-hand Apple computers, whether from Apple or others. Old ones should be fine for developing for iOS. More computationally intensive apps would be better on a newer machine.
AND, there are ways to set up virtual machines to run macOS. Large companies do this all the time. Linux users run Windows and macOS environments inside their Linux. Windows devs run Linux and macOS in their Windows. macOS runs Linux and Windows in macOS. There is some freeware out there such as VirtualBox from Oracle, but others as well. You'd still need the 'client' OS, so a license of macOS. My guess is that you could get that free from Apple since you're a student.
Another thing: you don't have to use Xcode to code for iOS and macOS. I'm pretty sure Microsoft VisualStudio provides environments for doing iOS and macOS programming. Free IDE's like Eclipse and NetBeans also have ways to do this to varying extents. There are plugins, mostly third-party, that help with this. You have many options.
I hope this helps enable you in some way to exercise the skill of coding.
Best Regards.