Private methods within a custom module I am grouping some shared functionality that will be used across multiple template files within a custom theme. I would like certain methods within this module to be accessible to the theme (ie. public) and certain modules only available to the module itself (ie. private). 

I understand that modules in Drupal aren't classes, but I hate the idea of the modules 'private' functions being available across the site - it seems to unnecessarily pollute the global namespace. 

Is there a way to hide/make private certain methods/functions within a module?
I understand that modules in Drupal aren't classes


Yes, however Drupal modules can certainly make use of classes, and many do.

You can use as many classes as you like. 

Put your private functions in class definitions and access them that way.

Include the class file in your module.info file:

files[] = includes/MyModuleClass.class.php


You can use public and private variables in your class

public $public_var;
private $private_var;


Add private methods to your class

// Public
public function myPublicFunction(){
  $this-&gt;public_var = 'Public';
}

// Private
private function myPrivateFunction(){
  $this-&gt;private_var = 'Private';        
} 


Instantiate an object with

$options = array(); // example constructor params
$object = new MyModuleClass($options);

echo $object-&gt;public_var; // OK
echo $object-&gt;private_var; // Error

$object-&gt;myPublicFunction(); // OK
$object-&gt;myPrivateFunction(); // Error


More info in the PHP OO docs 


http://php.net/manual/en/language.oop5.visibility.php
http://php.net/manual/en/language.oop5.php