Add PHP filters instead of theme function.php?

Sometimes I have to add filters like adding post-thumbnails or custom post types for Subscribe2. I end up having to put these in the theme’s function.php. I know this is a bad idea because it will get overwritten with a theme update. Is there a better place to put filters?

I was hoping for a plugin that would let me add custom PHP to my WordPress even if I change themes. How is everyone handling this?