The only exceptions I know about are Chile (which gives one year visas that are relatively easy to renew) and Panama (which will give you residency if you start a business there, it can be a small one.)
As for working you could just incorporate. It costs maybe 30$ and most hacker-type polish friends can help you with that. Later it costs $250 per month to own a company (mostly social security fees and health insurance, not sure if this is obligatory for foreigners but probably yes, plus service to help you deal with paperwork).
It's a great historical city to live & work where I've been staying for almost two years and still loving it =)
I can tell about Novi Sad (250k people, nice university, nice city center etc.), you can indeed get a livable flat for one or two people without kids for anywhere between 20k-35k euro. Though there are still some downsides to living in Serbia.
However, I was born and I still do live here as a freelance software developer (maybe at 30 hours/week, including time for learning new stuff), mostly Rails, nothing fancy, and I can tell that with a family of 4 I'm still saving 75% of my after tax income. Without trying hard to save money. That's what's keeping me from moving westward.
I'd say that medium town is from 50K to 200K people. Above that I'd call them cities but I don't think those are strict terms.
Here's a list of polish towns and cities: https://en.wikipedia.org/wiki/List_of_cities_and_towns_in_Po...
You'd get: no mortgage, apartment with a toilet, clean running water, wifi and all the electricity that you'll ever need. 5-10 times more area for your stuff. Monthly cost of utilities, tax and fee towards building maintenance of about $150 in total, access to a lot of young, English speaking people you could hire for cheap to help you with your projects.