I use "hide part" extensively in game. There used to be a bug where if you shift selected a bunch of parts and hid them it didn't actually take effect in game. I haven't tried that in a long while. It may or may not still be bugged. But many of my basic hull templates depend on hidden parts staying hidden in game for their animation illusions to work. When I manually add hidden equipment to ship designs, saving the design as a ship, the equipment components stay hidden.
You are looking for some template setting that allows a hardpoint to say, "the next weapon goes here and becomes invisible." or something similar. I have played a bit with encoded placement in a template. I have a Colony ship template that uses the Colony component as part of the visual design. I have it offset and mirrored in such a way that the dome shape of the component appears as a little sphere in the center of the design. When I used the template, added my first component as that Colony module, and let the Designer automatically place that part, it would come up on that hardpoint with the offsets and mirroring preserved. So, things like that are possible.
Right now, my posted template on Steam, called "Colon" still does that, but it does it to the second part I let the Ship Designer place, not the first one. I have no idea what changed to cause that change in behavior. It took me a long while to figure out the information was still hidden there in the template somehow. My workaround is to first place some other equipment, like an engine, and then place the Colony component, letting the Designer do the placement. The Colony module pops into place. Then I hide the engine. So, pre-placement works, sort of, but I have no idea just how it works anymore.