The DBConfig::isShardingEnabled function should only be called for metadata commands which want to prevent operations form happening on non-sharding enabled database. The only two such commands are copydb and shardCollection. All other usages should be removed.
Also, the DBConfig::getAllShardedCollections function is only used in the database-wide metadata commands movePrimary and dropDatabase. Since these commands must always run with a fully up-to-date metadata, there is no point in them using the cached collections list so DBConfig::getAllShardedCollections is unnecessary and should be removed.