You can’t “get government out of marriage” any more than you can “get government out of murder,” or “theft,”probate,” or etc.
The government isn’t “in the marriage business” any more than it is in the business of any of these other societal realities. But it must deal with them just the same.
Sure you can. Just treat everyone the same. Each person is an individual. All interactions between people can be contracted if they want legal standing.
Why MUST the gov’t be involved in marriage?