Checking against $TypeMasks::CorpseObjectType should work if you had an ID to the player while they were alive, killed them and checked getType() before the body disappeared.
It may be returned in a box/radius search but I'm not sure, it won't show up from a raycast since it has no collision.