If you don't have invisibility then you can try to either use barrels, timed bombs, or a grenade launcher to kill the Octopus, be careful to make sure you aren't directly in front, behind, above or below the Octopus or it will attack you and steal whatever you are holding.
If the Octopuses path is blocked by a block, then it cannot attack you.
Good luck, and happy Octopus hunting!
