" that it's not something I'm happy to discuss" is a perfectly fine answer.
It's private, not secret, you discuss with the child not with any tom, dick or harry.
I generally only tell people where it will benefit my ds.
So teacher - yes, privately, in case subjects come up in class that could be hard for a child - family genes, evacuees (totally came up!) etc
Doctor but be careful, I once told a doctor ds was not my biological son in front of him. It was totally relevant to the appointment but my son was quite upset and used that phrase for ages afterwards as a way to accentuate distance (in my view) and I wished I had not said it!
Close family because they do need to understand a bit about his behaviour and why he acts as he does and legally if me and dh died, they would care for him. So I share what is appropriate, away from ds.
Good friends generally are not told much, if anything.
Total strangers who do not know my ds may hear parts anonymously of his story if it is relevant, e.g. some people I've met in relation to adoption, people interested in adoption and I have been involved in some training of people who will be adopters. But again I woudl be very cautious to say as little as possible about ds's background and would rather focus on me as the adopter and what had helped me.
Sorry that is dreadfully long-winded!
Thank you LockdownLove for your perspective, it is so helpful.