Given what I found below, I believe he only performed a small segment of it in the 1991 film and it was not written for it, but it is attributed to him and two partners, much earlier in 1983.
tl;dr:
Sources are very limited on this, and search engines seem to be quite rubbish these days:
I believe, with little evidence, that it is a 1983 original song by David Carradine, (his girlfriend and soon to be wife) Gail Jensen (writer of the Unknown Stuntman for the Lee Majors TV series), and Michael Shanklin.
The full title is: Señor Problemas = Trouble maker
There was a video floating around of Carradine and Gail Jensen performing it together on The Merv Griffin Show in 1983, around the time he was promoting the release of his film Americana (which does not have the song on it) - but am currently unable to locate it.
David Carradine, Gail Jensen, Michael Shanklin (1983). Señor Problemas (Troublemaker) (vinyl single). Argentina: MICSA
https://en.wikipedia.org/wiki/David_Carradine

