I just drew the two routes on Google Earth and asked Kimi to perform a comparison. From just outside the mouth of the Malacca Straight directly to Japan is around 6,000 KM. Going around via Indonesia makes it about 10,000 KM, depending on how much extra safety distance you want to maintain away from the South China Sea and China itself. You're looking at about 10 days for the former and about 16 days for the latter, at a total extra cost of $600,000 to $1.2M per ship. I am pretty sure the Nip navy would be completely sunk soon enough if the Nips actively took up arms against China. There would be nothing to stop the Chinese navy from simply sailing back and forth around the East and South of Japan to stop ships from passing. Insurers would not cover commercial ships traveling those routes during a war scenario, so most ships would decline to ship to Japan regardless. The only ones that would, would do so only at price points high enough to cover losses from sunk ships. In other words, it would not be long before Japan ran out of industrial inputs, fuel, and food.