If you commit SHIRK and then repent in this life and do not shirk thereafter, you are forgiven. When Allah says that He will not forgive Shirk, it means that He will not forgive this sin if one dies while committing and believing in shirk.
Many of the sahaba were mushrikeen before coming to the fold of Islam. All of them are Razi Allah Anhu.