You should be fine...
A - You didn't hacked it in Japan, you're not a Japanese citizen either... Just a tourist... However, don't hack your new console in japan...
B - Piracy is also illegal and you won't find a lot of people being attacked for it (mainly hosting websites, not standalone users)
C - If your Switch was hacked before the law passed, you're fine.
D - A lot of japanese people do have hacked consoles, don't worry... They risk way more than you would...
E- Even if a policeman would look at you, they would mostly don't care for your case... I've seen some stories of police officers asking to hack their consoles and download games...