I don't like the idea of type-casing on `Function` / `PartialFunction`, I would leave the signature as is.

It would read more clearly to me to return `()` rather than `null` from this function, then no casting is needed.

```scala
scala> def foo[A, B](pf: PartialFunction[A, B])(a: A) { pf.applyOrElse[A, Any](a, (a: A) => ()) }
foo: [A, B](pf: PartialFunction[A,B])(a: A)Unit
```

The natural home for the hoisted `private val constUnit = (a: Any) => ()` is in the companion. But we might defer that until 2.11 for forward BC.

Until then, you could abuse the hoisted closure that sits behind `Predef.conforms`:

```
def foo[A, B](pf: PartialFunction[A, B])(a: A) { pf.applyOrElse[A, Any](a, Predef.conforms[A]) }
foo: [A, B](pf: PartialFunction[A,B])(a: A)Unit
```