I am confident that if you sent this:
-52 = ______
to every math professor in the world, just about all of them would fill in that blank with -25.
Did that
have to be the convention that everyone would agree on? No. You could make a perfectly good case that we should treat that as (-5)2 instead. But we don't.
Now, talking about how calculators and other computer programs handle it is a completely different (and not entirely relevant) question. They have their own conventions about how things are entered. If I type [negative] [5] [^] [2] in my calculator (at least the one I have here), it returns 25. That may or may not be correct. It depends entirely on whether or not I entered it correctly. By pressing the keys in that order, I explicitly told the calculator that I wanted to square the integer -5. If that's not what I wanted, then I needed to enter those commands in a different order.
But when one human writes -52 on a piece of paper, the convention humans have adopted when simplifying that by hand is to apply the exponentiation before the negation. -52 = -25. If that's not what I wanted, then I need to write the expression in a different way, to make it explicitly clear that I want to square the integer -5.