With the URL object you can build URLs inside a PyLucid plugin. Also the class has some joined media path information, for create urls and filesystem path to the media and internal page files.
If your plugin makes links, you should use the URL object and not build links "by hand" ;)
The important methods:
The URLs object has a debug method: self.URLs.debug() how display some information via the page_msg.