While the typhoons no doubt contributed to the defense of the shogunate against the Mongol hordes, Japan was very likely safe regardless. In fact, the Mongols had attacked multiple times before and also failed.
Indeed, Japan had never been successfully invaded in thousands of years. The first successful occupation of Japan by a foreign power in recorded history was by the United States in 1945, and it required nuclear weapons (the only nuclear weapons ever used in combat, in fact) and aircraft carriers.
The islands of Japan themselves, particularly the main island Honshu, are essentially a natural fortress. Instead of walls and a moat, they have mountain plateaus and the Sea of Japan. This has made Japan basically invulnerable to foreign invasion for millennia.
As a result, Japanese culture has grown and developed isolated from other societies at a level matched by almost no other culture. This is reflected in their language, which other than the borrowing of kanji from Chinese, has no other known languages in its family.