There are many alloys of titanium just like there are many alloys of steel and aluminum.
If you wanted it to last forever a chromium or cobalt nickel based superalloy is the answer It will only be $500+ for just the comp.
Steel alloys can have a good machinablity, low cost and long life. The more expensive and PITA it is to machine the better the life, just the way it is.
There are many titanium alloys for different purposes. My bet is most that become comps are not the best alloys for avoiding erosion due to availability and machinability.
A quality Ti comp will last as long as the barrel, so pick which ever one feels best for you. IMHO, I like a Ti comp on a 5" gun and a steel comp on a shorty.
Hard anodizing on aluminum is not really hard at all when you start talking about high pressure particulate erosion, but they are easy to replace so if you want super light and are willing to pay, just call it an expendable item.
Design is a whole different topic for gunsmiths with input from top shooters and maybe a gas turbine engineer.