Ok, I think I've got a reasonable solution. Although I have zero experience with scripting, and there may be some reason it would be easier to do certain things than others with a script. Instead of using the SF Fedora Shadow font, use SF Fedora. Type the text, then Duplicate. Fill the top one with your gradient. Select the bottom one (which is still black) and shift it down and to the left, until it looks like the Shadow version of the font. You may need to add a black stroke to the one with the gradient fill. Actually, since you're doing this via script, ......uh-oh.....
Ok...rrrrrch (apply breaks!) No, that won't work after all. I thought the fonts would be interchangeable, but they're not. The Shadow one has more space between the letters, to allow for the shadow to be there. Hhmmm......
Yeah, you know, I think someone else should probably answer this. Since I'm not familiar with scripting, I don't know if some things are easier to script than others. I was thinking that you could do some kerning, to make more space. But by the time you do that (different amounts of kerning for each letter combination) (which if I recall college beginning statistics (which is not likely) would be 26^26?? or 26 x 26??) you may as well find a way to use the Shadow font from the start.
I was trying to come up with some way to use a path operation to do this. But you have to go back and delete little "leftover" parts, which would be different for each word.....which I'm thinking would make scripting it very hard. Gosh, the more I think about this, the harder it seems to be, via script.
If I were doing it on the canvas, and only doing it once, there are a few ways to approach it. But I have no idea which way would be easier to script. I'll be glad to go over some of those ways, if you like. But it would probably be better for someone familiar with scripting Inkscape to reply. For all I know, this task could be easier via script, than it is on the canvas

And whadda you know, there's druban, posting once again, while I type, lol. But I see that I was not too far off base!