There are a few companies that exist to provide exactly that service, which kind of look like temp agencies. Gitlab uses CXC Global in my country, for example.
I work for a company in the bay area that has about 1/4 of our employees as remote now, and 5 years ago had none. A PEO like SOI/Trinet is what makes this possible
That becomes the contractor's problem unless you live in the few places where Gitlab has a legal presence.