I used to work at a gym (years ago), and saw this stuff all the time. Here's what I would do, which may or may not get you what you want:
1. Ask for the gym manager. This person's title varies by gym, but it will be the person in charge of that entire location. Their pay is largely based on how much money the gym makes, so be aware that they might not want to help you out, but if you explain that you gave a week's notice, ask nicely, and perhaps come up with a "hardship" story (maybe even hinting that when things turn around, you'd consider coming back), s/he might do something. (Just make sure the "come back" would be a hazy time in the distant future, or they will suggest putting your membership on hold.) They are likely the only person at that location who has the power to help you bypass the restriction.
2. Contact HQ. If you don't have any luck with the gym manager, I would get in contact with a person at HQ. Writing a letter to the area manager (in charge of several gyms) and/or someone even higher up might get you a result. This is likely to take longer, so your "result" might be in the form of a retroactive refund, but it's something. Again, mentioning a hardship and hinting that you might be willing to come back to the gym in a couple of years, after whatever it is has passed, could help get a result.
3. There is a way to cancel membership if you move further from any location than ~25 miles. You could feasibly ask a friend/family member to let you get some mail at their place as proof of moving in order to do it.
#3 and the hardship story element of #1 and 2 are at your discretion, since they are in an ethical grey area. For example, I probably wouldn't do #3, but I might be willing to exaggerate some aspect of my life story in order to make it into a hardship case that might get me a result from the gym manager.
Hope that helps!