The hiring company cannot treat you as a regular employee though (you are essentially a contractor), so you may have less 'rights' than a regular employee - i.e. your contract can likely be terminated a lot easier than a regular employment one. You may also not be able to get some benefits that a regular employee gets - ie contributions to pension funds, etc. These are often compensated by simply increasing your daily rate. I personally prefer it that way as I often find the benefits offered by the companies unnecessary.
There are also companies like deel.com that offer employers to hire people through their local branch office in pretty much every country in the world. FWIW I haven't used any myself but I have heard good things.
Hence I honestly consider remote working to be a solved problem already, but to each his own.
At some point us working in Mexico like this had better benefits than our peers in the US.
I work for a small company who has set up a legal entity to employ me and others in the UK while being based in the US themselves. Our US employees outnumber our UK employees 20:1 and yet our UK employees have better benefits than the US employees, _and_ we cost less for an equal salary (basically US healthcare is so expensive that it ends up being roughly equivalent to employing people in countries where you don't have to pay 10% of someone's compensation on healthcare) even when you have to put up with all the legal headaches
Hiring people as contractors rather than employees probably does simplify things. But a contractor may, for example, not be able to work for you full-time and you may not be able to offer them benefits beyond base salary. The bottom line is that, for a small company especially, hiring an individual who requires a lot of special care and feeding is probably more trouble than it's worth.
Hire them on a project basis. When one project ends, setup a new contract.
If it's easy enough for the average Uber driver, I'm sure the average HN reader can figure it out (because that's exactly how Uber works).
We had maybe 30+% of the team working that way, if we got big enough in a country outside the EU we set up a subsidiary there. Often a real pain to administer with a team of 100 people:, but sometimes the only way to make it work. Indonesia, India, Kenya, Burkina Faso, Mali.
Of course the original hiring company benefits/RSUs etc can't be passed through easily, you need to get those as cash.
Getting those benefits as cash defeats the point of them being those benefits in the first place.