modulestore() has a has_item method for this

    modulestore().has_item(location)