Is this strictly necessary?  I don't mean as in, does it solve the problem, but rather is this the correct solution.  If the homebrew hdf5 installation isn't being automatically picked up, isn't this indicative of a python/homebrew installation problem?  If that's the case, the correct solution here is to fix the root cause of the problem, rather than working around it.  i.e. install homebrew python and reinstall all the homebrew python deps if using homebrew python.  Likewise if using system python, homebrew python needs removing and all the homebrew deps reinstalling.  This will give you a system where it all just works, without any messing.  We might need to make recommendations to users about installation of python with homebrew and path setup, i.e. ensuring that the homebrew python is used in place of system python if that's our recommended setup.