"Basically, an AGW-supporting scientist polled a number of his AGW-supporting scientist friends and co-workers - 30 or so - and asked them if they thought AGW was real."
Not quite true. The original "huge consensus" rumor was started by an article (NOT a peer-reviewed paper) that appeared in Nature by one Naomi Oreskes, years ago. Oreskes claimed to have surveyed a database of science papers and concluded that none of them (not one) disagreed with the greenhouse gas global warming idea.
It was soon shown that Oreskes' "study" was in fact a textbook example of cherry-picking. She had searched the database for papers that included the phrase "global climate change". Only those were included in her analysis. The problem with that being that at the time, only papers that were ABOUT the effects of greenhouse gas warming mentioned the phrase "global climate change" at all. So, in effect, she selected out of the scientific literate just the papers about greenhouse global warming, and then conclude that they all agreed about greenhouse global warming! How surprising!
The fact was, of course, that the majority of climate papers were not about greenhouse warming and never mentioned the subject at all. But those weren't counted.
This "consensus" idea was bolstered by people claiming that almost all of the "thousands" of scientists behind the latest IPCC report had agreed about it. This, too, was a distortion of the truth. The scientists involved in the AR report at the time numbered in the hundreds. There were about 2,500 or so reviewers, and not all of those were scientists. Further, not all of them actually agreed.
Shortly after that, the Petition Project was undertaken to show that scientists in fact did not agree. Some 30,000 people with actual science or engineering credentials signed the petition DISagreeing with greenhouse global warming, and their names and professions are still publicly available at petitionproject.org. More than 9,000 of those were PhDs... far more than the 2500 who supposedly agreed, again many of whom had no advanced degrees.
Another "study" was done in this last year, which came up with that "97%" figure. Unfortunately, THAT "study" suffered from exactly the same flaw as the discredited Oreskes study: it searched the literature for papers that contained the phrase "global climate change". Self-selection at its finest.
And of course then there's the real kicker here: even if these "studies" had not been statistical nonsense, the fact remains that "consensus" is not science. If consensus were a scientifically valid measure of anything, we'd still be in the stone ages.