It could be due to a curse. Maybe there is a long - forgotten curse placed on the Uzumaki clan, and Naruto accidentally triggers it. This curse slowly changes his nature and makes him more like Pein. His friends notice the changes but are initially powerless to stop it.
A possible way for Naruto to become Pein in fanfiction is through a powerful genjutsu. An enemy, perhaps a new and powerful ninja, casts a genjutsu on Naruto that is so strong it rewrites his memories and beliefs. In the genjutsu, Naruto experiences a false reality where Pein's methods seem right, and when he comes out of it, the influence still lingers, and he starts acting like Pein.
In the fanfiction world, if Naruto were to lose all hope. For example, if all his friends were killed in a massive attack on Konoha. In his despair, he might turn to Pein's ideology. He thinks that the only way to prevent such tragedies in the future is to rule the world with an iron fist like Pein, using pain as a deterrent. So, he begins to transform himself into a being more like Pein, both in appearance and ideology.
Well, one possibility is that Naruto has some kind of premonition in the fanfiction. So he quickly rushes to Jiraiya's location where Pein is attacking. And he uses his shadow clones cleverly, distracting Pein long enough to rescue Jiraiya. He could also have some secret help from a new ally or an unexpected power boost from within himself.
Well, it could be that Naruto is exposed to a powerful and corrupting force. This force warps his sense of justice. Deadshot's character represents a more morally gray area compared to Naruto's traditional view of right and wrong. Maybe Naruto has a series of traumatic experiences that make him question his own values. He then sees Deadshot as a model of someone who can get things done regardless of the cost, and thus begins to transform into someone like Deadshot.
One possible plot twist could be that Naruto is not actually the real target. Maybe Pein was misinformed and Naruto has a secret twin or something. Another twist could be that Pein is being controlled by an even greater evil, and kidnapping Naruto is part of a larger scheme to take over the ninja world. Or perhaps Naruto has some hidden power that he himself doesn't know about, and Pein kidnaps him to try and unlock that power for his own use.
It could also be that a villain from the Shazam universe tries to take over Naruto's world. In the process, they create a situation where Naruto's chakra system gets infused with the magic of Shazam. This would be a really interesting development as Naruto would have to figure out how to use his new powers in a way that doesn't conflict with his ninja training. He might use his new - found flight ability to quickly get to different battle locations and his super strength to overpower enemies that were previously difficult to defeat.
Well, one way could be through some sort of strange magical or scientific experiment. Maybe a rogue ninja or a mad scientist creates a device that accidentally fuses Naruto's chakra with Frieza's essence. This would start to change Naruto's physical and mental state, gradually making him more like Frieza.
Well, it could start with Naruto being exposed to some dark chakra that warps his mind, making him adopt Bane's ruthless and power - hungry ways. Maybe he loses all his friends in a tragic event and turns to Bane - like methods to gain enough power to prevent such a thing from ever happening again.
It could be due to a magical artifact. Suppose Naruto comes across an ancient and mysterious sword - like artifact. When he touches it or tries to use it, it backfires and instead of him controlling the sword, he is transformed into it. This could lead to a whole new adventure as his friends try to figure out how to reverse the transformation.
Well, it could be due to a curse. There might exist a very ancient and powerful curse that was once sealed away. But through a series of events like tomb raiding by some evil forces, the curse was unleashed. Naruto, being in the wrong place at the wrong time, got affected by it and transformed into Shadow the Hedgehog.
Naruto might start to question his own identity. Being banished makes him feel like he doesn't belong anywhere. He could then start to explore his Namikaze heritage more deeply. He might discover secrets about his father that were hidden from him, and this knowledge could give him new strength and purpose. He could also use this newfound understanding to try and redeem himself in the eyes of the Hidden Leaf.
Perhaps there's a powerful artifact in the Naruto world that has the ability to transform people into different superheroes from other universes. Naruto stumbles upon this artifact and, not knowing what it does, activates it and is transformed into Ant - Man. He then has to figure out how to use his new powers like shrinking, communicating with ants, and growing back to normal size while still being a ninja.