While more and more specific answers are always possible, in the meantime you may be interested in this list of previous answers here Compiled by u/sunagainstgold
Hello!
My expertise is in Military Law in Polish - Lithuanian Commonwealth in the late XVI and early XVII centuries, a bit later than the sack of Cusco. But I think i can provide some insight.
The military law of the Crown of Poland went through a lot of iterations in this period. But one rule was constant through all of them. The rape of a woman was always punishable by death. No matter the station of the perpetrator or the victim. Even a member of the Szlachta would get the death sentence if he raped a peasant woman. Has this rule discouraged soldiers from raping women? To some extent, it was successful, especially in times of peace. We know about a soldier, named Stanisław Szczucki, who was accused of a multitude of crimes. Pillaging, murder, beatings, and, of course, rape. During his interrogation, he confessed to all of his crimes except the rape, despite testimonies by witnesses. That was because as a member of Szlachta, he could pay off most of his crimes, but there was no repentance for rapists in Polish Military law. Only death. Preferably by hanging, which was the most dishonourable kind of execution.
But despite this law's harshness, rape still happened and sometimes (we don't know how often) was unpunished. The problem with punishing rapists was that the victim or a witness would need to provide testimony. Many women of this time didn't want to live with the stigma of being a rape victim so they didn't report the crime. The stigmatization of rape victims is a very controversial topic, and because of it, we would never know the full extent of this vile crime, as many instances were unreported.
To summarize. In Polish-Lithuanian Commonwealth, rape was a crime punishable by death, but testimony by the victim or witnesses was needed to convict a perpetrator.