Perhaps he has to deal with guilt, even if it was in self - defense. He might also gain a reputation among the students, some seeing him as a protector, others as a bit of a loose cannon. The teachers might be concerned about his actions and keep a closer eye on him in future, worried that he's too quick to use lethal magic.
In the fanfiction, there could be a range of consequences. On one hand, he could be seen as a hero by his fellow students. They might admire his bravery and his ability to take on a dangerous troll. However, the teachers may be more cautious. If Harry used excessive force or magic that was not in line with the school's code of conduct, he could be given detention or even face a disciplinary hearing. Also, depending on how the troll was killed, there could be some magical fallout. For example, if he used a very dark spell, it could have an effect on his own magical core or his relationship with magic in general. Moreover, the death of the troll might also attract the attention of other dark creatures or forces that were somehow related to the troll, putting Harry in further danger.
Well, in some fanfictions, Harry might use his quick thinking and knowledge of the troll's weaknesses. He could first distract the troll by making noise or using magic to create illusions, then when the troll is off - guard, he strikes with a well - aimed spell, perhaps a blasting charm. Also, he could have some help from his friends. For example, Hermione might provide some crucial information about trolls that helps Harry come up with a plan. Ron could be there to support Harry, maybe by providing a diversion while Harry gets in the perfect position to deliver the fatal blow.
One consequence could be that he becomes a hero among his peers. Everyone in Hogwarts might look up to him even more. The other students could see him as a real dragon - slayer, which gives him more popularity and respect.
One consequence could be that he becomes a hero among the wizarding community. People start to look at him with even more admiration and respect. His reputation as a powerful wizard grows even stronger.
He might gain more respect from his peers. After all, killing the Basilisk is no small feat. His friends would probably look up to him even more, and his reputation in Hogwarts could soar. He could also become a bit of a legend among the younger students.
After Harry kills Voldemort in the graveyard in the fanfiction, the magical balance might shift. With Voldemort gone, some of the dark magic that was prevalent might start to fade away. The Hogwarts School of Witchcraft and Wizardry could see a new golden age. New spells and magical theories might be explored as the fear of Voldemort no longer holds back the wizarding scholars. Harry himself might start to travel around the world to spread the news of Voldemort's defeat and also to learn more about different types of magic. His friends would also have new opportunities, like Hermione might be able to further her studies without the constant threat of Voldemort and Ron could finally relax and enjoy a more peaceful life at the Burrow.
The wizarding world would likely be in a state of shock and then celebration. People would start to see Azkaban in a new light, perhaps no longer as just a place of horror but also as the site where the great evil was finally vanquished.
There could be some negative consequences too. Maybe the dragon had some kind of magical protection or was under the care of a powerful wizard or creature. Harry might then face the wrath of those who were protecting the dragon, leading to him having to go into hiding or facing dangerous challenges. Also, the act of killing a dragon, even in self - defense, might make some more sensitive wizards view him in a different, less favorable light.
It could also be that the situation was extremely dire. For example, the troll was about to destroy something very important, like a magical artifact that could cause great harm if it fell into the wrong hands, and Hermione saw killing the troll as the only way to prevent that.
One consequence could be the destruction of the friendship group. Ron, for instance, would be devastated. He has strong bonds with both Hermione and Harry. His reaction could range from seeking revenge on Hermione to falling into a deep depression. Also, the wizarding world as a whole would be in chaos. Harry was seen as the 'Chosen One', so his death would leave a power vacuum.
In the fanfic, after killing the dementor with Godric's sword, Harry could face some political consequences. The Ministry of Magic might be worried about this new method of dealing with dementors. They could either try to control Harry or study the sword. On a personal level, Harry might start to feel a greater sense of responsibility. He has proven that he can break the traditional boundaries of magic, and this could lead to him being more involved in the fight against the dark forces in the wizarding world. He may also face some opposition from those who believe in the old ways of handling dementors and don't want Harry to disrupt the status quo.