This function dtrt if applied to a Matrix, not a Function.  I think in that case it should just return straight away.  Additionally, instead of replicating functionality in apply how about:

````python
    def zero(self, r):
        """Zero the boundary condition nodes on ``r``.

        :arg r: a :class:`.Function` or :class:`.Matrix` to which the
            boundary condition should be applied.  In the latter case,
            this is a no-op.

        """
        if isinstance(r, types.Matrix):
            return

        self.homogenize()
        self.apply(r)
        self.restore()
````

?