Why can't they establish their cooperation rules between them, using existing static material (contract templates...) if they want to, without any third-party (for example a government) being mandatory?
Second, it doesn't really matter. Two people working together is pretty much politics. It's government. It leads there. Cooperation requires coordination.
In any healthy small community everyone tries to, in order to keep a good reputation. In case of misunderstanding any third party appreciated by both parties may act as a judge/referee. The need for a government, especially central, only arises when the group isn't anymore a community but a large set of (on average) loosely related and interacting persons.
> Two people working together is pretty much politics. It's government. It leads there. Cooperation requires coordination
Coordination nor politics doesn't imply any government.
And thus you invented government. As soon as you have an independent third party deciding who is right, that's your judicial branch. And then you will need the police to enforce the decisions of that judge/referee.
And then when you start having insane judges who rule that raping a child is perfectly fine, you will want to stop it, and thus you will invent your standardized laws.
> As soon as you have an independent third party deciding who is right, that's your judicial branch
There IMHO is major differences between "a single government, dedicated to regulate" (which attracts people willing to control others, often letting the most unscrupulous gain power) and "any chosen third party".
Where most people are most of the time reasonable they will oppose insanity, if necessary forcefully.
People who are reasonable most of the time don't need that much laws to govern them. It's the cases of conflict, violence, murder, property ownership, property destruction, and other negative things that inevitably lead to the invention of government, judges, police, prisons. Every country in the world has them, and for multiple reasons.