Actually, while testing and exploring the workaround, I discovered that IsBarren does not depend on who owns the asteroid, in other words, it will return true for any unplanted asteroid, not just team 0. GetNumTrees is also deficient as it only counts trees "above ground" and thus cannot distinguish between a virgin, ie completely unplanted, asteroid, and one whose trees all have their roots exposed. IsBarren is the only function I could find that makes that distinction, and it is an important one.
A virgin unplanted asteroid is fair game for any faction with enough seedlings present, no matter who owns it. First root to the center takes the asteroid. FWIW I do not think the game devs considered the possibility that barren asteroids would be assigned non-grey team owners so the function description is incorrect but it is much more useful the way it is.