Avoiding the cognitive penalty of interruptions is a skill that every programmer should develop. It's a big win in terms of productivity, and it only becomes more important when you become more senior and need to collaborate more frequently with other teams or provide support to other developers. Collaboration is where true productivity comes from anyway, rather than raw coding skill (above a certain baseline of competence, of course.)
In my experience, productive programmers often avoid the problem by just writing stuff down. If the guy in the comic strip had a pen and paper he could have quickly drawn those flowcharts he had in his head. Or he could have typed his ideas in comments or in a text file. But if he tries to hold such a complicated structure in his head, to the extent that he can't have a conversation with another person, he's just needlessly setting himself up for failure. I doubt he would make it through a lunch break or even a bathroom break if he can so easily lose track of what he is doing.