If you don't object to a product with an analogue in hook and loop tape, but more durable and substantially stronger, consider to locate 3M Dual Lock tape. It's available in various widths and lengths as well as different adhesive types. The strongest stuff has a gel type of adhesive, not quite foam, but squishy in a fashion.
The pieces are not "gendered" as with hook and loop. The tape has tiny stalks with mushroom heads that engage the other mushroom heads (get your mind out of the 60s here!) to form a very strong bond. The adhesive is weather resistant but I'm not so sure about sun resistance.
You'd attach one piece to the spike and one piece to the cleaned surface of the air conditioner.
The magnet idea is a good one, as you'd need only one magnet if your air conditioner has a steel casing.