The one thing you can do to avoid being banned, is to not run any homebrew as CIAs while online. Run everything through HBL using *hax, or use Rosalina and set your homebrew title to a legit one, so when you launch homebrew, it shows a legit title instead of homebrew.
While you are offline, nothing you do is sent to Nintendo, even if you go online afterwards. Your Activity Log is not sent to Nintendo, and your past history is not sent to Nintendo. Your favorite title or currently playing title is sent to Nintendo however, so as long as your favorite title is not an unofficial one, and you only run homebrew through Rosalina (with the homebrew channel set to a legit one, so it shows up as legit, or you run it through *hax), you have nothing to worry about as there is no information they could use to ban you.
However when you are online, your current title is sent to the server and saved forever.
But for what it's worth, I have had FBI as my favorite title in the friend list for a long time, and I haven't cared at all about what I run while online, and I'm still not banned.
Sure, there's no way to tell if I'll get banned all of a sudden, but so far it's looking good.
I don't think they are going to ban everyone that's ever used homebrew. It seems to be more complicated than that.