A2A by Z-Kat. Marc Ettlinger’s is the definitive answer:
Marc Ettlinger’s answer to Why do people use “Nope” even though “No” is easier to say and shorter to spell?
—but I was a research assistant for a guy who worked on labiovelars, and I’ve mentioned it here. (No doubt Z-Kat saw the comment.)
So supplemental to what Marc said:
A glottal stop is easily confusable with p, t, or k. But in the case of no, the confusion is going to be even more pronounced.
/w/ is a labiovelar glide. That means that the breathing passage is constricted in two places: at the lips, and at the velum (back of the tongue).
A glottal stop constricts—in fact, it blocks outright—even further back in the oral cavity than the velum.
What happens when you say a very abrupt “no!” ? You get a /w/, followed by a glottal stop: [nowʔ].
Now, what happens if you either produce or hear the /w/ and the /ʔ/ as the one sound?
The labiovelar glide turns into a Voiced labial–velar stop : [ɡ͡b] . The combination is pretty common in West Africa; e.g. Laurent Gbagbo (this one’s for you, Habib Fanny). The combination also turns up as an allophone in Vietnamese, for final -uk. My Vietnamese colleague was rather puzzled at my boss getting her to keep saying the Vietnamese word for bee, or whatever it was.
The labiovelar stop is not a common feature of English. So people may hear or pronounce [nowʔ] as [nowɡ͡b], or [nowk͡p]; but they can only make sense of it within English as [nowp].
Hence nope. And then, by analogy with nope, yep, and more recently welp.