I only do these exercises when it's fairly clear that the exercise is not a honeypot, but usually I'll direct the potential employer to my github where I have example projects that we can chat about. Here's my general rules about interviewing:
Once you get the senior level, especially if you've specialized in some of the latest-and-greatest, the pickings are slim enough for employers where they will usually go along with this. It's the larger companies or companies that think they're the shizz that'll throw a hissy fit about this. One company in particular got really snotty about it so I told the hiring manager "if you don't have ownership over the process of hiring people on your team, then you aren't the hiring manager, kindly direct me to who is." They ghosted me after that.