I do not believe that you can return it to NULL if the list does not contain anything else, which also partially corresponds to the input. Therefore, if there was a bak element in your list, then foo $ ba will return null since the partial match was not unique.
> foo <- list(bar=2)
> foo$ba
[1] 2
> foo$bak <- NA
> foo$ba
NULL
, , / .
> options(warnPartialMatchDollar = TRUE)
> foo <- list(bar = 2)
> foo$ba
[1] 2
Warning message:
In foo$ba : partial match of 'ba' to 'bar'
, , . , NULL , [[
$
, , , [[
.