Fair use doctrine was obviously never intended to apply to reimplementing API's either way because it didn't exist yet.
Rather than have a court make up some kind of ultimately arbitrary precedent ruling either way, Congress should be debating the ramifications of whether reimplementing API's is explicitly fair use or not, considering both pros and cons to the economy, with opportunity for all tech companies to weigh in -- and then pass a good law.
Courts interpret law, they aren't supposed to make it, and the Supreme Court certainly isn't even remotely qualified to determine what's the best policy for a healthy dynamic tech economy here. The law is so ambiguous here that Congress is shirking its duties by not establishing relevant law here.
In times like these where Congress is often deadlocked, someone needs to make decisions. Congress can pass a new law if they can get their act together.