The Psychic Block Defense is a step up from Psychic Static, it stops an enemy using a Mind Probe, Telepathy, and various forms of Mind Control from getting at the owner's juicy brainmeats by putting up the mental equivalent of a Blue Screen Of Death. It's a step up because it's always on, and slapping, distracting or KO'ing the defender won't shut down the defense. To continue the computer metaphor, this is to do with it being a "hardwired" defense rather than one that is executed after startup.
It comes in two flavors: specific memory blocks and full mind defense. The former is a passive defense used to protect sensitive secrets from enemies, and may even be doubly defended if the owner isn't aware he has them in the first place. The latter is a much more active defense from being taken over, it will give enemies a Poke in the Third Eye if they put their brains where they don't belong, and may even turn the tables and let the defender sneak into the invader's mind.
One of the most impressive things about this trope is the variety of ways it can be represented. Frequently it manifests with a theme regarding the character's organization or whoever installed the block, as a form of signature. For example, a servant of the Milk Man Conspiracy may have the details of their secret base protected inside an unbreakable mental milk bottle that can only open with a specific code phrase. Even a non-psychic can have one with the right training, or thanks to a friendly psychic installing one.
Inferior shields will allow the attacker to know you're hiding something. A really good shield may let the invader think he got access to what he was searching, and feed them false information. This is also the best defense to employ against something or someone trying to find you with Psychic Radar.
Insanity Immunity is a Sister Trope, where the immunity/resistance to psychic invasion or interference is due to inherent madness. See also Battle in the Center of the Mind.
In recent issues, it's revealed that Cyclops, despite not being a telepath, has a small box inside his mind that Emma can't move or open, which contains secrets to do with the safety of the X-Men. Jean taught him how to do it.
The very nature of Gambit's bio-electric powers render him very difficult to mind-probe — Professor X compared reading his thoughts to trying to grasp a snake coated in oil. Not impossible, but certainly mentally taxing and liable to hurt the Cajun just as much. He also has purposely-placed psi-blocks. He lived among four of the world's most powerful telepaths for years while hiding the fact that he used to work for Mr. Sinister and helped create the Marauders.
X-23 has displayed a degree of resistance to powerful telepathy. It took Emma Frost a great deal of effort to bypass Laura's mental defenses in order to learn her true nature (though afterwards Emma was able to taunt her with a mental ghost of Laura's slain mother). Her genetic parent, Wolverine, has displayed a similar resistance in the past, but it's unclear if this is a result of their Healing Factor, training, or a result of tampering by Weapon X/The Facility.
William ClanDestine can do this; the specifics of how it works aren't really explained. His oldest sister, Kay, is a powerful telepath who completely lacks Mind Over Manners, so it's less surprising that William can do this than that so few of his siblings seem to have tried to do something similar.
In ElfQuest's "Rebels" title, Chandra is described as "no training, but her natural shields are too strong to punch."
In Kyon Big Damn Hero, after Koizumi manages to link himself with other people than Haruhi to feel their emotions, he realizes he's unable to create a link with most of the SOS Brigade. He compares his inability to create links differently depending of the person, ranging from feeling like a strong wind, to being completely undetectable.
In Forward, all of the "Blank"-type psychics have this capability, coupled with Anti-Magic. Empath-type psychics (like River) are unable to read the Blanks, while Inducer-type psychics are unable to influence them. In addition, the Academy has also developed implants that allow non-Blank troops to reduce the effectiveness of psychic abilities on them.
Used fairly often in Harry Potter fanfiction set in Order of the Phoenix where Snape is ostensibly teaching Harry Occlumency. Fanfiction being what it is, the defense usually involves Harry having sex with half the female cast and using memories of it to thoroughly squick Snape out.
In Spider-Man Chronicles Volume One: Origins, Spider-Man seems to have this. Jean Grey mentions in Chapter 49 that she has a harder time than usual sending telepathic messages to Spider-Man because she has to overcome his natural resistance to telepathy first. And more than one villain has failed to use mind control on Spider-Man thanks to his spider sense going crazy when they try, which seems to help Spider-Man to resist long enough to stop the villain.
In a chapter of For The Love of My Friends Ino decides to read Shikamaru's mind for some reason (I forget why..) but he stops her by picturing a psychic Labyrinth surrounding the information that Naruto is from a future.
Films — Animation
Superman vs. the Elite: Superman's mind is protected from telepathic probing by a series of psychic blocks, which Manchester Black admits are the "best he's seen." Of course, just because Superman is immune to mind probing doesn't mean that Black can't do other things with his powers, like telekinetically pinching the veins and arteries in Supes' brain.
Films — Live-Action
This is the kind of thing that projections automatically try to do in Inception — although by default they just want the intruders out (that is, dead) — but people with the right training have much better-organized and better-armed projections. However, the actions of these projections are still unconscious. This lets Cobb turn Fischer's conscious mind against his own sub-security.
Magneto's helmet in the movies, which he is shown obtaining in X-Men: First Class, to block out Professor X specifically.
Emma also has the ability to block Xavier's mind-reading powers, and cover herself in diamond-like skin to shield her mind.
The Mind Shield, Psi-Screen and Kai-Screen disciplines in Lone Wolf. They are mostly geared toward protecting from psychic combat or mental damage (which, to be fair, are a favorite of many creatures of Magnamund). Mind control is harder to defend against, and some especially powerful telepaths may manage to slip in and read Lone Wolf's thoughts while he's busy shielding his psyche from trauma.
John Carter of Mars: For some unexplained reason, Martians can't read John Carter's mind at all. However, he can read theirs just as easily as they can each other.
In E. E. “Doc” Smith's Lensman series, Boskonians often used mind shield devices to protect themselves from telepathic probes (such as from Lensmen).
In the Twilight stories, Bella Swan has a completely effective, passive mind shield which prevents anyone from reading her thoughts. In the last book, when she becomes a vampire, she learns how to extend her shield to protect others against all forms of mental attack, and how to lower her shield to let Edward in.
James H Schmitz's Federation of the Hub stories: Mind shield devices were commercially available, and creatures known as Old Galactics could provide them to their symbionts (such as humans).
In most of the Dresdenverse, since the White Council tightly regulates mind magics, Harry has very poor, basic defenses which the Corpsetaker can easily breach. However, in the Dresden Files novel "Ghost Story", due to training from Harry's faerie godmother, Molly mounts a more effective defense. Harry only gets inside because he knows the person well and knows where to look during that person's Battle in the Center of the Mind with the Corpsetaker.
Deryni have what they term "shields" which can be adjusted from a complete blockage down to transparency. The more skilled a Deryni is, the more control s/he has over the adjustment. Since Deryni are also empathic, the shields are quite necessary to protect Deryni from the strong emotions of others as well as keeping their own thoughts and feelings private. Shields can be affected by head injuries or drugs like merasha, and they rapidly degrade when a Deryni dies. A few people thought to be human (Sean Lord Derry and Sir Kenneth Morgan, Earl of Lendour de jure uxoriusLat. in right of his wife among them) are found to have rudimentary shields. Psychic walls can also be constructed in the minds of people (human or Deryni) who have sensitive information that must be protected.
Takhisians in the Wild Cards series can learn to do this. The most "safe" defense includes conditioning yourself to commit telepathic suicide the instant someone breaks the wall, meaning it is impossible to read your hidden thoughts as all.
In The Damned trilogy by Alan Dean Foster not only humans are immune to psychic powers of Amplitur, but applying telepathy to humans turns out to be very painful and near-fatal. Later we find that Lepar are immune too, but they don't hurt Amplitur.
In the Star Wars Expanded Universe, Mara Jade has this power. Apparently the Emperor taught it to her. (Quite why he thought it so important to give her anti-psychic powers when his regime had slaughtered all the trained psychics aside from himself and The Dragon, well...)
All Others have this ability in Night Watch, no matter their level. However, a block is unlikely to work against a stronger Other. A scene in Day Watch has Anton and Alisher (who meet for the first time) test each other's mental defenses. Anton wins not by brute force but by trickery (he feints by reducing his defenses, as if Alisher's attack has managed to batter them down, then slips "under" Alisher's own block, when the latter becomes overconfident).
All telepaths in the Firebird Trilogy have three forms of this, with the strength of each shield dependent on the strength of the telepath:
A basic mind shield that blocks out the emotional signals of those around them.
A shield that keeps their own emotions under control.
A shield that prevents other telepaths from entering their mind, unless the other telepath is strong enough to break through the shield.
A fourth variant is the Spec Ops amnesia block: a specialized mental technique that allows a telepath to cut off certain selected memories from his conscious mind, rendering them inaccessible by interrogation, telepathic or otherwise. Only a few specially trained mind healers know how to reverse the effects.
Presumably why Tosh can't read Jack's mind while wearing the pendant in the episode "Greeks Bearing Gifts". He says he could feel her "scrabbling about in there" but for some reason she couldn't hear anything unless Jack deliberately communicated a thought. This is likely a result of his training as a Temporal Agent. Given how many psychic beings are there in the universe, an operative needs to be able to keep others out of his mind. Even Torchwood-One privides some resistance training to weak psychic influence.
A more straight example from the same episode is Mary, who could control which of her thoughts Tosh heard.
The xenophobic Devore Imperium in Star Trek: Voyager train their soldiers specifically to resist intrusion from telepaths, allowing them to better defend themselves whilst they hunt them down in their space. Although, given their well-known intolerance for telepaths, it raises the question of how they actually train or confirm they've gotten this ability?
Explained in an early episode as visualizing oneself building and maintaining a wall around them inside their mind. This is used both passively by Telepaths to block out the deafening white noise of the surface thoughts of everyone around them, and actively to defend against specific attacks from other telepaths.
This defense is primarily used by trained telepaths, it is also stated that Mundanes can do this with sufficient practice and willpower as well, assuming they know it is happening (or are paranoid enough to do this on suspicion alone).
One of the first demonstrations of Lyta's new Power Level after being Touched by Vorlons involved her doing this to recurring villain Bester so hard that it actually physically slaps his head back.
Ivanova reveals that she can do it, after training herself to resist her mother's scans. However, it turns out that it's because she herself is a latent telepath. It's strange that she wasn't tested, as, according to Expanded Universe, telepathy is passed down from the mother.
In Buffy the Vampire Slayer, when Buffy temporarily gains telepathy, she tries to use it on Angel. He notices it and tells her that it's impossible, since like with mirrors, vampires' thoughts don't cast any reflections.
In Doctor Who, the Doctor often demonstrates the ability to do this, such as in "The Shakespeare Code" and "Fires of Pompeii" where he is able to shield his true name, even from those already reading his mind. In "Nightmare in Silver" he also demonstrates the ability to effectively lock off entire sections of his mind, preventing a Cyber-Controller attempting to take him over from gaining Time Lord secrets.
In The First Doctor serial "The Space Museum", the Doctor gets shackled to a chair in which all of his mental images are broadcast onto a screen for his interrogator, who finds out the location of his companions from him, before making the mistake of explaining that this is what he's doing and showing the Doctor the screen. From then on, every question results in the weirdest images popping up on the monitor - "how did you get here?" results in an image of a penny-farthing, "where did you come from?" results in some weird Stock Footage of sea lions swimming in the ocean, and when his captor starts yelling at him he starts making it display slightly overweight naked people. This works, but his irritated captor decides to put him through museum specimen preservation as revenge.
GURPS has the Mind Shield psionic ability and the Mind Block cinematic skill.
In Traveller Classic, psionic characters with the Telepathy ability could use the Shield power, and an Artificial Psionic Shield Helmet was on the list of available equipment. In the Mongoose edition, the Mind Shield blocks inbound and outbound Telepathic powers as long as it's up, and flat out stops the shielded individual from being picked up by Psychic Radar.
Gamma World first edition had the Mental Defense Shield mutation.
Members of the Secrets Caste of the Sidereal Exalted have the innate ability to immunize themselves and those around them from mental scrying. Furthermore, Sidereals specialized in their own unique astrological magic can feed false information to nonmagical astrologers attempting to read their minds or futures.
Psykers with the "Living Nightmare" trait have full mind defense against mind-reading attempts: Trying to read one will give little more than white noise. Although mind-control is still possible, Living Nightmare psykers have a +15 bonus to oppose mind control when compared to an equivalent character without the trait.
In Mage: The Awakening, any mage of at least Apprentice-level proficiency in the Mind Arcanum can do this at a second's notice.
Rifts and other Palladium Books games have a psychic ability called Mind Block, which simply prevents psychic attacks altogether while it is active. A more powerful version, Mind Block Auto-Defense, acts as an automatic defense that triggers anytime the user is under psychic attack, at the cost of a permanent reduction of the user's psychic energy capacity.
Along with the more common Psychic Static, the clairsentients of Trinity can learn a technique that allows them to completely bury memories and snippets of information until such time as they need to remember them. This frustrates the telepaths of the setting to no end.
All Ce-Matoran have this trait naturally in BIONICLE. It can also be acheived by rigorous training, as done by the Order of Mata Nui.
Koishi from Touhou. After she sealed off her third eye, she gained the ability to move around completely free of thought, rendering her immune to all kinds of mind-reading and detection. The block is not so much against others as it is Koishi shutting her own mind out. She can't be read because there's nothing to read.
Nanomachines can be used to put up psychic barriers in Metal Gear.
Sam & Max: Freelance Police: Max might be the President of the United States, but there are even things he's not allowed to know, as evident by trying to read Agent Superball's mind.
Agent Superball: I am afraid that the contents of my mind are classified, sirs.
Adepts in Golden Sun are able to detect when other Adepts are trying to read their mind. This is usually less of an outright block than it is an interruption (Alex turning around and sassing the guilty party aloud), a Poke in the Third Eye (Karst giving death threats through her thoughts), or a screen of Psychic Static ("Ivan, stop reading my mind!"), but during a cutscene close to the end of the first game, Isaac & friends block Sheba trying to learn about Ivan's staff.
Aylee from Sluggy Freelance briefly has a form with this power, an adaptation against Leono's probing of her mind.
Captain SNES: Daos thinks this happens when he breaks through Alex's mind and finds a blinking smiley face. The truth is is that Alex really is absolutely terrified of Evil Otto from the Berserk arcade game.
Vriska states that it's very difficult for her to Mind Control other trolls with Psychic Powers or a strong will, so using Aradia or Terezi is not an option. However, Sollux's "vision twofold" only grants him resistance half the time. Her powers don't work on humans very well either, as she seems to only be able to put them to sleep.
As Heroes of Void, Equius and Roxy are naturally immune to scrying, existing inside of dark spots in oracle's perception. This extends involuntarily to Mom Lalonde of the Post-Scratch Universe who is said to have "VISION OMNIFOLD" and even the functionally omniscient Doc Scratch couldn't detect Darkleer, Equius's ancestor. Of all things, this ability is compared to the fluid in a Magic Eight Ball.
Ocelot and the other Foxhound members in The Last Days of Foxhound have special nanomachines that block out psychics much to Mantis' displeasure.
Eric Mahren (later Caitlin Bardue) in the has this, in a sense. Prod the wrong memory, and you get to relive the sensations of being shot, or worse. It's lampshaded by one of the doctors there: "It'd take a guy like Mahren to turn his own brain into a minefield."
Tennyo, Fey and Carmilla also have this. Tennyo's is just a absurdly powerful always-on mental shield, although she appears to be able to drop it partially if she chooses to. Fey and Carmilla both use permanent uses of their powers, a spell for Fey and a psychic construct for Carmilla. Anyone breaking those is also likely to break the effects containing the always-active Mind Rape level auras they have and find themselves incapacitated by lust or reverence. Carmilla also can duplicate Marhen's minefield trick by being an Eldritch Abomination.