Is there an faster algorithm to rotate 2 opposite corners? I can't find anything else but doing the sexy move multiple times.
This algorithm can be adapted to do what you need.
F D' F' D F D' F' U' F D F' D' F D F' U
To deal with non adjacent corners where one corner is on the right hand side of F (corners in a diagonal), rotate U twice instead of once in the algorithm, i.e.
F D' F' D F D' F' U2 F D F' D' F D F' U2`
If both corners are far opposites (do not share any faces), make sure one corner is on the right hand side of
F (as before), rotate
L2 and then apply the original algorithm, and rotate
L2 to finish.
Consider algorithm 25 on this page: https://solvethecube.com/algorithms
It is this: F' (r U R' U') (r' F R)