If Modi is pragmatic, then the US is 10x more pragmatic. They will deal with whoever is in power and, if Indian business leaders even suspect that Modi is harming their business interests (with the US) because of personal tantrums, they will castigate him so fast, it will make his head spin.
Is he also anti-Japan? There is no secret what's behind the 'strategic' partnership being touted between Japan and India.
India's foreign policy has been carefully crafted over the decades to play all sides against each other. If Modi is smart, he won't mess with a proven formula. India's foreign policy will not change significantly towards most countries.
However, I suspect Modi would take a stronger approach towards Pakistan, Bangladesh and Sri Lanka. The reason is two-fold: it will mollify the Hindutva crowd that he is "looking out" for Hindu pride, and it will also satisfy the secular Indians who want a visible validation of India's new status. Modi won't mess with the big players, but he will recalibrate India's relationship with PK/BD/SL. India will adopt a more belligerent/assertive/muscular (adjective depending on reader's position) role.