I write command line tools primarily with Python and one thing I always try to do is to limit myself to the standard library, which, with Python, is quite sufficient for most of what I do.
Anyway, most of what I write is designed to be installed in a virtualenv, which restricts the blast radius to one specific application.