The obvious answer is a rock. You need to disguise as a rock of equal mass to your ship. Then gravity sensors would not show an anomaly that would attract attention. The rock panels would need to fit together very tightly, and be on insulated stilts to keep them space cold. That would do to trick the IR sensors. The inside/backside of your rock panels will need to reflect all energy signatures, effectively blinding you while you have the rock shell up. Being able to cover the 270 degrees of ship closest to the pirate's path is important. The reflected energy will exit the remaining 90 degrees (or less) like a search light or beacon, possibly warning other ships in that direction of the danger here.
This panelling is not retractable, only re arrangeable. Retracting it would bring it close to (or inside) your hull which would heat it up. Then when you deploy it you would be a lumpy bright spot on the IR sensors. You can only re arrange this panelling around the ship to keep it out of the way of you engines and sensors.
When you dock somewhere, the fact that your ship employs this camouflage will be easily visible to all, because it will be stacked up on its stilts around your ship. If the pirates watch you depart, calculate your path, and catch up, they can look for rocks of this size to find you. Obfuscation of your path will be necessary. However, not knowing they are looking for this kind of rock, most pirates do not circle every space rock along their path.
Security through obscurity; we use it on servers in cyber defence all the time.
Note Go to the linked IR Sensor pirate raid to see the hard-science reality-check answers crushing all hope ... if this were not worldbuilding.stackexchange.com and permitted to invent ideas.