I think there are a lot of companies that do location-independent pay, so you should look into interviewing at one of those. My impression from a cursory look at what I see on these companies blogs is that they skew very low for someone that lives in New York or San Francisco, but that doesn't seem to be your situation.
Another option is to just move. I think you come out ahead, as pay seems to linearly scale with the cost of living change, but many expenses are fixed. (For example, nobody says "every software engineer should have $1650 for their 401k, $3000 in pocket change, and whatever the average rent is in their city of choice". They say "We aim for $200k in NYC" and if housing is 50% cheaper somewhere else, pay you $100k. That means your 401k, pocket change, etc. scale down proportionally, and that's the part that's unfair. So move to San Francisco!)
You could also find a company that pays more in your desired location. Google's software engineers in Madison, WI probably get paid more than some random startup in Brooklyn, NY. Even if it's location based, you can still get yourself more money.
Finally, if you're contracting, nobody really needs to know what city you live in. For full time employees it's tough to lie about this because of taxes, and of course fraud is a crime. I definitely know of people that claim to live in Pennsylvania but actually live in New York City, for tax reasons. This is fraud and is illegal, but people do do it. Maybe location-based pay tips the scale towards "meh, I can do 5 years in prison with 10% probability". I'd personally avoid going down that road. If you're a contractor, though, nothing stops you from starting a company in a high cost area, billing through the company, and never mentioning (except to tax authorities) where you actually live. Again, I wouldn't recommend this as it sounds like a huge hassle, but everything can be gamed. The upside of contracting is that you're negotiating your compensation several times a year, instead of a handful of times throughout your career. The downside is that if nobody really needs your skills, you make $0 for that period of time, which can be pretty rough.
I think my TLDR is that I'm guessing you don't actually love your job, so you should probably find a different one. That's how you get paid more as a software engineer. Some employers keep their fingers on the pulse of the market and give you raises to keep your compensation within the %-ile that they decided, but 99.99% don't. So, you find a new job every 2 years. That's their fault, not yours. I worked at one of the 0.01% that did keep refreshing comp as the industry landscape changed, without me ever asking, and that was the job I worked at longest.