Unfortunately this among many other things, takes more work than one would find logical.
Thankfully, we can use the app.executeMenuCommand("expandStyle"); command to break down the appearance of an art item.
Have an item selected and run this command.
In the case of text, if it has its fill as the No-Color, the text will now have its' appearance color as the character fill.
If there is a fill set on the text and there's an appearance fill, or if there are several appearance fills, it will turn into a group of text items, each with the respective appearance fill now having moved into the character attributes.
Awesome this worked for me.
It is worth noting that if you are storing a reference to a textFrame before running the 'expandStyle' command, and you have more than 1 fillColor applied (such that the textFrame turns into a group, as described above) your reference will be broken.
This was a source of some headache for me. The solution is to ensure that the text has the colorFill set in the appearance panel and the normal text color is set to no color/transparent.
This way when calling 'expandStyle' your text should not turn into a group, but stay as a textFrame object. This is not always immediately apparent as there isn't much difference in illustrator's UI, but the steps are: Select your textFrame, set the fillColor to no color/transparent, then add a fill color through the appearance panel.
And for when you cannot rely on the files being strictly controlled as you say, you can duplicate the item and expand it, check the selection to see if there's a group in it. Then remove the [duplicate] item but get the returned result of your test.