How do I get a node, or a taxonomy term URL knowing the node ID or the taxonomy term ID?
The generic way is this:

$uri = entity_uri($entity_type, $entity);
$url = $uri['path'];


So for a node, $entity_type would be 'node', and $entity would be the fully loaded node object.

Taxonomy terms are also entities in D7, so the syntax would be similar.