Make it private but Serializable:
[SerializeField] private GameObject whatever;
This way it will show up in the inspector but code from other classes can't reach it. Nothing is stopping you from changing the value from inside your own class though.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…