The show has no logical character development.
With book Jaime it isn't primarily about his Hand or losing Cersei, it is about Tywin dying (the HAND is actually a symbolic nod to Tywin and Jaime's future, as Tywin was the Hand of the King and Jaime will eclipse him in that position). Tywin dying leaves a void that for the good of the realm someone must fill, and the only person willing and able will be Jaime. The role is that of doing the dishonourable for the greater good, such as threatening to load a baby into trebuchet to end a siege peacefully. Under the umbrella of Tywin's protection Jaime could afford to play the reckless uncaring child, without Tywin it's either Jaime does it or nobody does and the realm pays. Jaime's willingness to stand dishonour and the realm's hatred for the sake of a greater cause is meant to contrast with Tyrion who above all else craves love.
To the question of if it made him or was it always in him - it has always been in him. He cut down the king he was sworn to protect, then hunted the pyromancers down like dogs. He is ruthless, calculating and logical in his cause. The problem was after having been judged the kingslayer he went off the rails and rather than serve a greater good he began serving was his own selfishness and Cersei.
People think it's about good and bad, or from dishonourable to honourable, they're wrong, it isn't. It is from selfishness to servant. Jaime's future is to be the realm's greatest servant, that means doing even more vile heinous shit than he has already done in the realm's service. The king eats, the Hand takes the shit. He's also likely to be tortured and mutilated further than just his hand, he is to give over everything he holds personally, including his body, for the realm.