surprised to find that "bastard" is a term of endearment.

It is so not only in Australia. To some extent - and under similar conditions to those described by Marty - it is in use in UK as well. Even when not used as a positive term of endearment, it is frequently used here in a non-perjorative way as an alternative term for "person."