I need to pass a node id to a block I am open to doing that with hook_ module code (since i'm doing all my work in a custom module), and I'm open to doing that with Panels, which I'm using.  I don't want to add PHP in the admin interface.

Thanks in advance.
Not quite a block, but you can do this with custom panel panes and pass it the $node being viewed.  This is the cleanest way.  I don't have a link handy for an overview on how to do this, though.

You can also do something similar using a view, and wiring up the relationships / arguments appropriately.  You can then stick this view into a panel pane.

The hack is do do something like this in your block code

if (arg(0) == "node" &amp;&amp; arg(2) != "edit") {
  $nid = (int) arg(1);
  if ($nid) {
    // do stuff
  }
}