What a weird thread.
Anyway, OP, what you could do is play as /afk or /dnd or simply turn whispers off on your chat box. Then have your friends whisper/talk to you through the battle.net chat instead.
In this way will only get messages from your friends.
If you wanted to appear to be offline to other players…that’s not an option and it’s likely it will never be an option. I don’t know if your goal is to stop gold sellers or if other players are harassing you. If it’s the latter you can /ignore.
If it’s an acquaintance that wants to play with you and you don’t want to play with them but you don’t want to be rude…then you have no good option. Either go /afk and hope they think you’re idle or just eat your social anxiety and tell them you don’t want to play with them.
And lastly - I’m not sure I know what MMO’s have a privacy feature like this. I haven’t played many other MMO’s but I’m very positive nothing like this exists for the other mainstream MMO’s like FFXIV or ESO. I don’t think that you can claim this is a standard MMO feature unless I’m just totally out of the loop or completely missed that functionality as I played other games.