How to add PHP to a node without php filter?
It really depends since you're planning to add functionality then the best place would be a module but if you're altering HTML or basically the output and maybe quite a little raw data manipulations then that could be in your theme.

Mostly a basic question that needs to be asked is, do you want the "thing" to be functional when you turn off or change your theme? If yes then that would give a strong idea that you would be creating a custom module.

For adding PHP code with panels, you can create custom panel panes. For nodes, your can use blocks or hook_preprocess_node() to add your code in the node level.