Sadly, there isn't one.
This is most likely because Rockstar Games wanted to create an increased level of realism in Red Dead Redemption 2.
Even in their most recent GTA game, Grand Theft Auto 5, the invincibility cheat is limited to a maximum of five minutes before you need to enter the code again.
So we think that the most likely reason why there is no invincibility cheat in Red Dead Redemption 2 is that Rockstar wanted to continue with the "policy" they began in GTA 5, and decided to completely remove such a cheat from the game all together.