According to the OnMouseDown documentation
This function is not called on objects that belong to Ignore Raycast layer.
So, one way of doing this is switching the layer of the object to Ignore Raycast.
this.gameObject.layer = LayerMask.NameToLayer("Ignore Raycast");
But if you have other functionality that depends on raycasting, those will be disabled too (unless they are raycasting in other layers).