My family, and quite a few friends, have a serious history with alcoholism so this scenario is very familiar. I think it's worth thinking about this in two ways simultaneously: As a humanitarian and as a business decision.

From the first angle, I believe (and others might disagree) that you have an obligation to offer as much support to this person within your capabilities. Understand however that there is nothing you can do to change them - they have to determine that it is a problem that they need to fix. This person KNOWS that they have a problem. Hallmark of an alcoholic is denial - but rest assured they know that it's a problem.

So then how do you help? Well it all depends on the situation. Your team hovering over in amazement while they code certainly doesn't help as it just feeds the idea that "I'm at my best when I'm drunk." Which is clearly temporally bounded.

Unfortunately there is no single solution, and simply pointing you toward AL-ANON or AA is kind of the nuclear option in most cases. Also don't assume that this person cares about self preservation as much as you do. If they just lost all of their important connections, they are likely severely depressed, but my guess is that they are mostly LONELY.

You aren't going to solve that overnight, but it might be possible to find ways to reduce their loneliness. Ask them to dinner, go bowling, whatever it is that would be good. Depending on their personality this might work better as a group or as individuals YMMV.

Alternatively you could force the issue hard by letting them know that this is unacceptable behavior. This one is risky though because this usually further isolates the person and the outcome sometimes is very bad. In some cases it works, but you really have to know the person well.

On to the business side...

Your business partners need to determine what kind of liability this person is to accomplishment of the job broadly. Despite your Rainman like description, the fact that company resources (Even if voluntarily) are being placed on ferrying this person home for risk of life, is a major issue.

This can and will likely lead to resentment towards that person, which usually starts as a joke ("Who's taking barney home tonight" guffaw..) but in my experience turns into vitriol quickly ("I can't believe I have to help this asshole again"). In turn that will lead to trouble with team-dynamics and you can take it from there. No amount of rainman like coding can overcome everyone hating to work with you or the unpredictability of it.

If you or your partners need to issue an ultimatum to this person, that might help, but without other social support could also be isolating. This one has more eggshells on it because it's higher stakes.

If it were me I would offer this person a paid leave of absence, so they could go and be with other friends or family - or in lieu of that, find someone to augment their work and reduce their workload until they can get back on their feet, while keeping them in the office and socializing. Can your team afford that? No idea what your situation is, but if you value this person, then you'll figure out a way to do it.

Bottom line: Support, don't carry. Nudge, don't drag.