whether its a hack depends on more than the code supplied, if by the time that code is run headers have already been set (or any content has been echoed) then its a hack.
If no output has been sent and therefore no http headers sent then no it is not a hack...
....unless you could have predicted this failure before getting to this page in the first place... which makes it a hack again
as a general rule I think that if you need to use ob_start() just to supress header warnings then its probably a hack, if not then probably not, but thats quite subjective and I don't know your dev team manager