Professional bodies or academics do sometimes survey their fields, especially when it's politically important to make a point, eg
Two thirds of economists say Coalition austerity harmed the economy
Top economists warn ending social distancing too soon would only hurt the economy
Rival schools of thought often organise letters implying that their stance is the 'consensus' (whether or not that claim is reasonable). Or a campaign to establish a new consensus is launched in an academic paper.
For some fields, like medicine, various organisations produce guidelines, which are increasingly evidence-based rather than opinion-based (ie they look at the evidence rather than surveying professional opinion). The guidelines are not necessarily the consensus but if there are substantial errors or omissions these are likely to be protested and, where appropriate, corrected. Consensus groups are sometimes convened to produce statements with some weight but they are vulnerable to manipulation; I know of one which reconvened after new data were available and the chair (who was well-funded by the drug company) simply expelled everyone who'd changed their minds.
So, there are some formal and informal mechanisms but it's really very difficult to discern what 'the' consensus is from outside of a field (or even from outside of a very specific niche within a field). The sorts of claims you cite in your OP are often quite reasonable but they're often also misleading (and quite difficult to prove either way). If anything important rests on the claim, you need to dig a bit (lot) deeper to find out if it's reasonable. And, of course, bear in mind that facts change and today's minority might be tomorrow's majority.