(maint) Remove unused/inefficient code
The optional_parameter_count method isn't used anymore, the signature
calculates that as it figures out the signatures. There were also a few
places that used slightly inefficent means of doing things. Using a proc
reference instead of a block is much faster. It also removes some
garbage creation that isn't needed during the type signature
calculation.