Yeah, as a person who often does 3k words in a sitting, frequently for days or weeks in a row, and has never done cocaine.... it's not the cocaine, and it's not a god-given physical trait like being the "hottest friend".
It's practice. Not just practicing writing in general, but intentionally practicing for speed. I have taught writing in formal settings, and the thing that seems to most frequently slow people down is the amount of time they spend tinkering with, worrying about, and sweating over every individual sentence as they write it -- and then they've written 800 words and they're fucking exhausted, because all of that worrying takes a LOT of cognitive energy. Turn your brain off. Practice not caring if it's a perfect sentence because you can fix it later. Just slap some bullshit on the page. Keep your fingers moving.
If you can type 60wpm, and you type without stopping, you'll have 3k in under an hour. Now, realistically, I'm a fast writer, and I do still pause to do a LITTLE tinkering now and then, so I compose at a rate of around 25wpm, even though my top typing speed is around 80wpm. At 25wpm, 3k would take me roughly an hour and a half. Let's round it up to two and a half hours for a couple thinking breaks.
The point is, this is doable. 25wpm for two and a half hours, including some thinking breaks. It's not particularly superhuman, any more than being able to run a mile is superhuman. It just takes intentional training towards a specific goal and prioritizing what you're spending your day on.
When you first start practicing for speed, then yeah, a lot of what you produce is going to be garbage, and step one is to let that be perfectly fucking fine. Your mantra is "It doesn't have to be good, it just has to be done" -- it's a lot easier to edit a pile of raw material than to try to get it perfect on the first go. As you practice, you'll get more adept at the writing craft part of it too, so the product will not be garbage stream-of-consciousness anymore. The sentences will start to snap together one after the other like lego bricks.
But you don't get there if you say, "Well, it was just the cocaine" or "This isn't applicable to me because Stephen King is doing a completely different activity." Neither of those things are true. He's a regular human being, and I'm a regular human being, and so are you. Writing fast is a learnable skill, just like being able to run a mile or any equivalent feat of physical exertion. If you don't WANT to learn that sort of skill, you definitely don't have to. But there's a difference between deciding that you don't WANT to learn the skill and reflexively deciding that the skill must be impossible, and when I see people saying "That seems impossible, so there's no point to me even trying," it makes me sad.
Because there's no such thing as impossible. Some things are just Very Tedious.