If you have thoughts of shirk but you don’t actually believe in them would you have committed a sin?
And what I mean by having thoughts of shirk is you, yourself bringing those thoughts to mind (not waswas or OCD thoughts).
These thoughts only won't make you kafir.But you must try to avoid them and do not do any action according to those thoughts.Whenever those thoughts come in your mind try to do something else.Keep your mind busy in any useful works or anything which makes you happy and positive.And a scholar told me if thoughts or doubts come in mind it's waswasa of shaytan and we should say "amantu billah". And ask Allah to help you.
No, it's not a sin or shirk/kufr (depending on condition) unless you perform any action based on these thoughts. A better way to kill such thoughts is questioning and answering them. You have such thought and you answer it with a logical response. That's it. If you don't know the answer. Find the answer in Quran and Hadith or ask any scholar. This will help you kill such thoughts as well as gain more knowledge about Islam.